The Second Moroccan Crisis (the first was in 1904, and was known as the Tangier Crisis) occurred on 1 July 1911 when Germany sent the gunboat Panther to the Moroccan port of Adagir, supposedly to protect German interests during the recent Berber rebellion. The real reason was to further cow the French over colonial interests on the continent.
The Adagir Incident caused an international panic (Britain even began to prepare for war). The crisis was only resolved by an international convention held on 4 November 1911. France was given a protectorate over Morocco (ratified by the Moroccan Sultan 'Abd al-Hafiz with the Treaty of Fez on 30 March 1912) and Germany was ceded a strip of land form the French Congo. Spain initially objected, but further negotiation by Britain resulted in the Franco-Spanish treaty of 27 November 1912, which revised the mutual boundaries of French and Spanish holdings in Morocco.
One additional result of the Moroccan Crises was the development of the Tangier Zone as an international economic free zone (of Tangier and its environs) in 1923.