Draft:19th-century Morocco

The history of Morocco in the 19th century, also referred to as "Pre-colonial Morocco", is a period marked by increased European influence and intervention in Maghreb, and mostly fruitless moroccan attempts at modernization. This era began with the isolationist policies of Moulay Slimane, cutting off Morocco from European trade. The sultanate was eventually forced into opening itself, from 1822 onwards, to foreign trade and influence due to a series of political and economic factors.

This period was also marked by three major wars in which Morocco was an active belligerent, the first Barbary War, the Franco-Moroccan War of 1844 and the Hispano-Moroccan War of 1859 (also known as the War of Tetuan or the War of Africa).

By the end of the 19th century, and under the rule of Abdelaziz I, the sultanate was on the verge of civil war and total collapse. Being mostly threatened by France from Algeria and Spain from Ceuta and Melilla, it no longer had the capacity to defend itself militarily and was eventually subjected to a Franco-Spanish protectorate in 1912.

Pre-Alaouite Morocco
Morocco was subjected to a wave of imperalistic invasions from Portugal and Spain in the 15th and 16th centuries. It eventually managed to retain its independence under the Saadi dynasty after decisively defeating the Iberian alliance at Oued El Kebir in 1578, with Ottoman support. After a short period of prosperity, the sultanate would again fall into chaos and civil war after the death of Ahmad Al-Mansur in a plague epidemic, in 1603. The Saadi dynasty eventually fell when the Alaouites from Tafilalet overthrew them in the late 1660s and united Morocco under their rule.

Political situation
With the death of Moulay Al-Rachid, who united Morocco under Alaouite rule, the country would again be plunged into a long-lasting civil war between Moulay Ismail and his nephew, Moulay Ahmad Ben Mehrez, from which Ismail would emerge victorious. Under his leadership, the country knew a military, economic and cultural revival. But after his death in 1727, Morocco would again fall into a bloody civil war in which 7 pretenders to the throne will fight until 1748, ending with Moulay Abdallah's victory.

Moulay Mohammed Ben Abdellah (also known as Sidi Mohammed III of Morocco) became sultan peacefully in 1757, and the country knew a new period of peace and development in which diplomatic ties with european powers would florish. Morocco also became the first country to recognize the newly independent United States in 1776 (de facto). After his death in 1790, Moulay Yazid, known for his brutality against Jews, would succeed and reign for two years until his death in 1792.

Economic situation
Due to the many internal conflicts Morocco knew during the 18th century, it left very little opportunity for the rulers to modernize and industrialize the country. Thus, the sultanate remained a very rural and decentralized entity, in which tribes had de factor independence but were nominal subjects of the sultan (which was also known as the Amir Al-Muminin). Trade with Europe was important but it could not compete with already established powers such as Spain or Portugal, and was limited to exports of slaves mainly captured from the Sudan, raw minerals and food. Except for coastal cities, most of Morocco remained isolated from the world.