The Spanish Protectorate in Morocco was established on 27 November 1912 by a treaty between France and Spain that converted the Spanish sphere of influence in Morocco into a formal protectorate.
The Spanish protectorate consisted of a northern strip on the Mediterranean and the Strait of Gibraltar, and a southern part of the protectorate around Cape Juby, bordering the Spanish Sahara. The northern zone became part of independent Morocco on 7 April 1956, shortly after France relinquished its protectorate. Spain finally ceded its southern zone through the Treaty of Angra de Cintra on 1 April 1958, after the short Ifni War.