The Spanish protectorate in Morocco (Marruecos Protectorado Espanol) 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 had ceded its protectorate (French Morocco). Spain finally ceded its southern zone through the Treaty of Angra de Cintra on 1 April 1958, after the short Ifni War. The city of Tangiers was excluded from the Spanish protectorate and received a special internationally-controlled status as Tangier International Zone.
Since France already held a protectorate over the entire country and controlled Morocco’s foreign affairs (since 30 March 1912), it also held the power to delegate a zone to Spanish protection.