Rami was born in Tafraout, Morocco, the son of a Berber sheikh.[1] While attending the école normale supérieure in Casablanca, Rami joined the National Union of Popular Forces. After graduating in June 1963, Rami taught history, geography, French and Arabic at secondary schools in Casablanca. In autumn 1965, Rami enrolled in the Royal Military Academy in Meknes with the intention — as an officer — of becoming more effective in his opposition to the regime.[1] Following the arrest and disappearance of Mehdi Ben Barka, Rami became resolved "to enter the system in order to destroy it."[2] Rami became a tank lieutenant in the Royal Moroccan Army and claims to have had close ties with general Mohamed Oufkir.[1] Convinced that the King of Morocco Hassan II was a puppet of Jews and the Central Intelligence Agency (CIA), Rami participated in the 1972 Moroccan coup attempt.[2] He sought and obtained political asylum in Sweden in 1973.