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 into a formal protectorate. The surface area of the protectorate was about 20,948 km², which represents 4.69% of modern-day Morocco. 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.