In 1911, the conquest of Morocco was initiated by the French Third Republic, in the aftermath of the Agadir Crisis. While the conquest itself lasted until 1934, the Treaty of Fez was signed on 30 March 1912. According to the treaty, most of Morocco would become a French protectorate from 1912 to 1956, when the country regained its independence.
References
List of French residents-general in Morocco Wikipedia(Text) CC BY-SA