Draft:History of Morocco (1666–1912)

The Alawi Sultanate (السلطنة العلوية), officially known as the Sharifian Sultanate (السلطنة الشريفة) and colloquially as the Sultanate of Morocco, was the state led by the Moroccan Alawi dynasty from their rise to power in 1666 to the Treaty of Fes marking the start of the French protectorate in 1912.

During this period, the Alawi dynasty would take control of the sultanate after the collapse of the Saadi and Dilaid dynasties, and unify Morocco under their control. The sultanate would know a resurgence and a golden age during the reign of Moulay Ismail.

This period is also marked by catastrophic demographic collapse, as Morocco's population fell from around 7 million in the 1590s to 2.69 million in 1820 because of a series of plagues and other natural disasters throughout the 1700s and early 1800s.

Etymology
Morocco, since the rule of the Saadi dynasty, has been referred to as the Sharifian Sultanate as a reference to the ruling dynasty's claim as descendants or sharifs to the Prophet Muhammad. This was rendered in French as l'Empire chérifien (lit. 'the Sharifian empire'). It was referred to as Sultanate of Morocco by Anglophones. The Alaouites were at first known as the Sharifs of Sijilmassa or Sharifs of Sous.

Origins of the Alawi dynasty
The ruling dynasty of the Sultanate, the Alawis (lit. 'descendants of Ali'; sometimes rendered Filali Sharifs), rose from the settlement of Sijilmassa in the oasis of Tafilalet. Their ancestors are believed to have immigrated from Yanbu in the Hejaz in the 13th century during a drought that affected the region. The dynasty claims descent to the Prophet Muhammad through his grandson Hasan, the son of Ali and Muhammad's daughter Fatima.

The patriarch of the dynasty is believed to be Moulay Hassan ben al-Qasim ad-Dakhil, who established a religious aristocracy with his lineage throughout the oasis. Known for his deep piety, he was believed to have moved to Sijilmassa in 1265 under the rule of the Marinids at the request of locals who promoted him as imam of Tafilalet and viewed the presence of sharifs in the region as beneficial for religious legitimity.

He left behind a son, Mohamed, who in turn had only one descendant who bore the same name as his grandfather. One of this descendant's sons,, undertook the pilgrimage to Mecca and participated in the Moroccan–Portuguese wars in the 16th century and was also invited by the Nasrids to fight against Castile in the Iberian Peninsula during the Granada War. He declined to settle in Granada at the request of scholars in the city but rather settled for many years in Fez and Sefrou before returning to Tafilalet.

Collapse of Saadi rule
The rise of the Alawis came in a context of religious and social unrest and increasing European pressure in the country's coastal cities. The Saadi dynasty ruled over Morocco since the second half of the 16th century after triumphing in a long civil war against the decaying Wattasid dynasty. However, by the early 1600s, the sultanate was on the verge of total collapse. Moreover, a plague epidemic, likely imported from Spain, occured in the 1590s and early 1600s and ravaged Morocco.

The Saadi sultan Ahmad Al-Mansur (1578-1603) would chose one of his least capable son as heir, which would prove terribly detrimental to the survival of his dynasty. Following his death, approximately half of the Saadi dynasty's existence was marked by armed conflicts for the throne between his sons and other rival factions. Weak control over internal affairs and inability to resist foreign interference led to the rise of separatist movements. Excessive taxation further burdened the population, who were ready to support any learders capable of alleviating tax pressure.

Early Alawi expansion
In 1637, Moulay al-Charif (1631-1636), the leader of the Alawi dynasty, was arrested and deported to Sous by Cheikh Bu Dmi’a of Tazerwalt, after expressing his discontent with Cheikh Bu Dmi’a's expanded influence in Tafilalt, following a dispute with the inhabitants of the qsar of Tabouasamt in 1631 or 1633. Upon his release and return to Tafilalt, Moulay al-Charif discovered that he had been abandoned by his supporters, who had meanwhile proclaimed his son, Moulay Mohammed ibn al-Charif, in his place.

Moulay Mohammed expelled the emir of Tazerwalt from Tafilalt in 1640. Encouraged by this success, the new Alawi leader embarked on the conquest of Draa and the northeastern regions of Morocco, where he secured the submission of the Arab tribes of Upper Guir, also gaining control of Oujda in 1641 and Touat in 1645. He also ventured into territories under Ottoman rule, reaching the outskirts of Tlemcen and Nedroma, but quickly turned back after he received threats from Pasha of Algiers. During his reign, he clashed many times with the Zaouia of Dila, who became a rival power competing for total control of Morocco after the total collapse of the Saadis. In 1646, Sijilmassa was sacked by Dillaite troops, after Moulay Mohammed was defeated in the battle of El Qa'a by the Dilaite leader Mohammed al-Hajj bin Mohammed. The Alawis ended up losing vast swaps of lands to the Dilaites, most importantly all the territories below the El Ayach mountains, and even became subjects of the Dilaites. In 1649 Mohammed al-Hajj bin Mohammed was proclaimed sultan in Fez after the death of the last Saadi sultan Ahmad Al-Abbas, a move which sparked a revolt in the city. Profiting from this situation, Muhammad Ibn Sharif chose to intervene to take the capital, but was defeated in a battle near Dahr Erremka on August 19, 1649. The Dilaites pursued him to Sijilmassa where they sacked the city a second time.

Between 1665 and 1670, Moulay Rachid brought most of the country under control of the Alawi dynasty and became the first Alawi sultan of Morocco following his Conquest of Marrakesh in 1668.

Apogee under Moulay Ismail (1672-1727)
In 1672, Moulay Rachid died in an accident and left power to his brother, Moulay Ismail. Moulay Ismail consolidated power despite rebellion from other family members, notably his nephew Ahmed ben Mehrez. Ben Mehrez died in battle near Taroudant in 1686.

Reign of Mohammed III (1757-1790)
The situation in Morocco gradually stabilized following Moulay Abdellah's accession to throne, but it was under the reign of Sidi Mohammed ben Abdellah (1757-1790) that the country truly emerged from the civil war.

Reign of Moulay Slimane
Following his accession, Moulay Slimane could not successfully establish his authority over his brothers Moulay Hisham, Moulay Hussayn, and Moulay Maslama, and faced opposition from the dissenting population in Chaouia and Haha regions. It took him seven years of concerted efforts and military operations to achieve his goals. However, shortly after consolidating his throne, he confronted the consequences of the devastating plague epidemic that swept through Morocco in 1799-1800.

Reign of Moulay Abderrahmane ben Hicham
Moulay Abderrahmane ben Hisham served as the khalifa of Tafilelt, Essaouira, and Fez, before peacefully ascending to the throne.

Reforms and modernization efforts
The Sultan expressed indignation at the way slavery was conducted in Morocco, with members of the lower-class being subject to random enslavement.

In 1882, Sultan Moulay Hassan I prohibited the public sale of slaves as well as random enslavement, writing that "it is an impious act that one could not ignore or tolerate this misfortune which has occurred in this time, it is the outright reduction of free people into slavery without any legal base".

Collapse and French protectorate (1894-1912)
Ahmed al-Hiba, the son of Ma al-'Aynayn, the religious leader who founded the city of Es-Smara.

Government and politics
19th century Moroccan authors classified the Sultanate as both being a caliphate and an imamate.

Makhzen
The pre-colonial administration in Morocco, known as the Makhzen (lit. 'warehouse')

The authority of the Sultan in Morocco were both political and religious, with his authority revolving around his title of Commander of the Faithful (amir al-muminin) and oaths of allegiance (bayahs) made by tribes to the Sultan.

The extent of the Sultan's authority was classified in two categories mainly based on taxation. Bled el-Makhzen (lit. 'land of the Makhzen'), which included most of the country's Atlantic coast and urban areas and was directly governed and taxed by the Makhzen under the direct rule of the Sultan. In contrast, Bled es-Siba (lit. 'land of anarchy') held tribal autonomy and self-governance but held an oath of allegiance to the Sultan and recognized his religious and spiritual status but refused to pay taxes to the Makhzen.

Despite this, the distinction between Bled el-Makhzen and Bled es-Siba remained vague and fluctuated. The decision by some tribes to refuse to pay taxes to the Makhzen were sometimes used as a bargaining chip to obtain favors rather than dissent from the Sultan. In many cases, governors in Bled es-Siba reported their investiture to the Sultan.

Judiciary
In Bilad el-Makhzen, common law matters and some civil and criminal cases were judged by courtrooms which ruled by Islamic law and were presided by a qadi (judge), where parties could choose an oukil (council; equivalent to a lawyer) to represent them in court and present fatwas (advisories) written by a faqih (jurist) using Islamic jurisprudence to present their case or defense. After the sentence was pronounced, a governor for the Makhzen was charged with enforcing the decision. Contracts and marriage certificates were registered by two adouls (notaries) and were signed also signed by a qadi.

Most civil and criminal cases were judged by a courtroom ran by the Makhzen and led by a pasha (governor) or a qaid (commander) which enforced tazir punishements in criminal cases. The Makhzen courts were often favored over religious courts due to their speedy trials. However, the jurisdiction of the quasi-secular Makhzen courts and the religious courts often overlapped and a party in a Makhzen dispute could request to raise the case to a religious court.

Moroccan Jews were given judicial autonomy and were allowed to set up courtrooms which enforced Hebraic law and rabbinical jurisprudence among themselves. However, Islamic religious courts were favored to judge in cases involving both Jews and Muslims. Matters involving Europeans were judged by the consul of their home countries. If a Moroccan was subject to a lawsuit from a European, the consul would file the complaint to a Makhzen courthouse on behalf of the European complainant.

Within Bled es-Siba, a number of rural courtrooms were set up by tribes in Morocco which judged based on a mix of Berber customary law and Islamic law. These included arbitrational "court of laws" in villages for civil disputes and tribal "court of appeals" in criminal or appellate case. In some cases, complainants were authorized to enforce legal rulings in their favor through means of violence.

Relations with the British Empire
In a letter from Moulay Ismail to the exiled King James II of England, dated February 16, 1698, the Moroccan sultan invited King James II to consider embracing Islam or reverting to Anglicanism, and advised him to reside in Lisbon, facilitating a return to England away from French influence. In the letter, Moulay Ismail offered King James II arms and the Moroccan naval force to spearhead a new invasion of Britain.

The French colonization of Algeria led to a gradual erosion of trust between England and Morocco in the late 1830s.

On February 26, 1842, British consul John Hay Drummond Hay sent a letter to Moulay Abderrahmane requesting that slavery be abolished in Morocco as it was "unacceptable in civil society and to rational people", the Moroccan sultan replied with a refusal as it was allowed under Islamic law.

In 1844, the British and Foreign Anti-Slavery Society attempted to deliver a letter to Moulay Abderrahmane through the governor of Mogador. The governor refused to relay the letter to the Sultan, telling the Society that such attempts would be futile.

In 1860, both the French and British governments sent a delegation to propose the abolition of slavery to the Moroccan government.

In 1863, after negociation with the Foreign Anti-Slavery Society, the Sultan of Morocco granted protection to runaway slaves by signing a decree that "any runaway slave seeking refuge in the Makhzen (the Moroccan authority) and requesting its protection would not be sent back to his master".

Relations with the Ottoman Empire
Under the reign of Mohammed III, Morocco would choose for the first time a policy of positive reconciliation with the Ottoman Empire after a long period of stagnation, which aligned with the country's broader initiative of opening up to the West, and was not achieved to this scale before.

Relations with the Netherlands
During the thirty years civil war, the Dutch managed to oust the French from Moroccan maritime trade, and shared in the commerce passing through the country's four principal ports: Tétouan, Salé, Safi, and Agadir.

Moulay Abdallah was the first Alawi sultan to sign a "treaty of peace and security" with a European state, the Netherlands, in 1750. This treaty ensured free trade between the two countries and established the first permanent European consulates in Morocco.

Relations with the United States of America
The Sultanate of Morocco was the first country to de facto recognize the United States on June 23, 1777. Sultan Mohammed III signed a decree granting ships from the newly-independent country protection and free access to Moroccan ports. The Sultan previously expressed his desire to be a "friend of the Americans". Morocco formally recognized the United States on June 23, 1786, when a treaty of peace and friendship was signed.

Culture and society
During the 18th century, a number of Tachelhit poets arose including Mohammed Awzal in Taroudant and Sidi Hammou Taleb in Moulay Brahim.

Cobalt sourced from the Bou Azzer mine, near Ouarzazate, was commonly used as insecticide and rodenticide by Moroccans after being mixed with arsenate.

Religion
Islam in Morocco was primarily defined by Maliki doctrine intertwined with Sufism. Inspired by Wahhabism, a crackdown on Sufi brotherhoods and mystical orders in the country was led by Moulay Slimane for practices he deemed to be sinful. This crackdown stopped under the reign of Moulay Abderrahmane ben Hisham, which helped him consolidate his rule.

Mass media
During modernization attempts for the Moroccan state under Moulay Abdelhafid to counter European influence, a draft constitution was published in the October 1908 issue of newspaper Lissan-ul-Maghreb in Tangier. The 93-article draft emphasized and codified the concepts of separation of powers, good citizenship, and human rights for the first time in the country's history.

The draft, which was written by an anonymous author and was never signed by Moulay Abdelhafid, was inspired by the late 19th century constitutions of the Ottoman Empire, Egypt, and Persia. In 2008, al-Massae claimed that the draft was written by members of a "Moroccan Association of Unity and Progress" composed of an elite close to Moulay Abdelhafid which supported the toppling of his predecessor, Moulay Abdelaziz.

Banking
The first Moroccan bank in the foreign exchange market was the Pariente Bank of Tangiers, which was founded in 1844 by Moses Pariente which cooperated with the Anglo-Egyptian Bank. In 1881, a branch of the French Banque Transatlantique was opened in Tangier by businessman Haim Benchimol.

In a debt restructuring effort, the Moroccan Debt Administration was created in 1904 which later merged in 1907 to become the State Bank of Morocco as a central bank. The State Bank of Morocco was later restructured after the end of French colonialism in Morocco and renamed to Bank Al-Maghrib in 1959 and still serves as Morocco's central bank.

Agriculture
In pre-colonial Morocco, the predominant economic structure was centered around a rural subsistence model. Local farms were commonly held collectively, known as bled el jemâa. Established customs regulated land usage and distribution among families. Despite economic setbacks occurring periodically, civil conflicts at both national and local levels and the primitive tools employed, there remained a significant emphasis on soil exploitation and agriculture constituted the primary occupation for the majority of rural inhabitants. Numerous lands became contested territories among various groups and tribes, which sometimes prompted the Makhzen to intervene in order to settle the disputes.

Pierre Tralle, a French prisonner who also participated in the construction of Meknes over a seven-year period until 1700, highlighted in his report on the Moroccan situation the fertility of the land which he considered to be adapted to producing high-quality crops.

Despite opening to trade in the late 19th century, Morocco faced limitations due to inadequate agricultural surplus and the antiquated transportation system, which hindered commercial activities. Foreign land ownership was largely unattainable before colonization, even though European powers secured legal exceptions allowing land speculation around major harbors through treaties such as the Treaty of Madrid in 1880 and the Treaty of Algeciras in 1906.

During the latter half of the 19th century, there was an increased interest on irrigation and agricultural activities, particularly under the reign of Mohammed IV, sparked when he was still the caliph of Marrakech. This interest lead to the creation of various water sources in the region, and the construction of a canal originating from, as well as another canal named Fitout River which transported water from Tastaout to the plains encompassing Zemrane, Rahamna, and Sraghna. Throughout the 19th century, the Chaouia region rose as an important grain and livestock exporting hub through the port of Anfa, despite governmental policies restricting exports.

An important shift in the types crops cultivated was observed in many regions prior to the establishment of the protectorate. The cultivation of olive trees, once prevalent across the coastal plains along the Atlantic coastal regions and the Rif, significantly declined.

The Atlantic plains were renowned for the quality of their wheat, barley, and abundant vineyards, while vegetable cultivation was primarily concentrated near urban centers. Morocco also produced oranges, almonds, walnuts and figs. The introduction of new crops, such as aloe vera from the Americas, and potatoes from Europe, affected agriculture in Morocco. During the 19th century, the cultivation of plants like henna, flax, hashish, and turmeric gained prominence. Forested areas retained their original situation and composition, comprising oak and argan trees, and other species like willows, junipers, and pines.

Taxation
During Moulay Ismail's reign, the sultanate's revenues primarily derived from taxes, with the two main sources being the Ashur and the Ghrama. The Ashur was collected in kind, constituting one-tenth of all agricultural produce, while the Ghrama was paid in cash according to individuals' wealth. The governors determined the amount of these taxes based on their knowledge of the population and the state of harvests.

Coinage
The Alawis did not initiate the development of a new national currency until 1668, instead allowing local currencies to circulate for an extended period. In 1668, Moulay Rashid decided to introduce a new silver currency called mouzouna that consisted of 20% copper with the ultimate goal of boosting regional trade. Previous Saadi and Dilaid gold currencies continued to circulate until the reign of Moulay Ismail, who decided to emit a new gold dinar called bunduqi.

1590-1610 plague epidemic
During the reign of Ahmad al-Mansur, the Saadi sultanate was plagued by famine and pestilence for nearly five years. A plague epidemic, which originated in Spain, was brought to Morocco by Sephardic Jews, Andalusian Moors, Moriscos, and Hornacheros who had been fleeing persecution, in what was islamic Al-Andalus, since 1492. This resulted in the depletion of livestock and crops, depopulation of urban and rural areas, total societal breakdown, and severe damage to the sugar industry, a vital component of the Saadi economy.

The plague, following a series of natural disasters since the early 16th century, reached its peak in 1598, subsided briefly, then intensified until 1607 or 1608, claiming between a third and half of the population, which before the plague did not exceed 7 million. This also played a key role in the destruction of the administrative infrastructure established by the Saadi rulers, which contributed to the fall of the dynasty 60 years later. Ahmad al-Mansur is believed to have been himself killed by the plague, in 1603.