Sultan of Morocco from 1822 to 1859
"Moulay" Abd al-Rahman bin Hisham (; 19 February 1778 – 28 August 1859) was Sultan of Morocco from 30 November 1822 to 28 August 1859, as a ruler of the 'Alawi dynasty. He was a son of Moulay Hisham. He was proclaimed sultan in Fes after the death of Moulay Sulayman.
During his long reign he proved himself competent in an age where Africa was being colonized by stronger European nations, such as neighbouring Ottoman Algeria which was invaded by France. He was able to preserve Moroccan independence and maintain Moroccan borders without ceding any land, while also supporting Emir Abd al-Qadir's resistance in Algeria against France. He also signed the necessary treaties to enforce his beliefs, and fought numerous conflicts with European nations, especially France. 
Biography.
Abd al-Rahman bin Hisham was born in Fes on 19 February 1778 to Hisham bin Mohammed and his wife a lady of the Oulad Jerrar tribe. Following the death of his uncle Sulayman, Abd al-Rahman was proclaimed sultan of Morocco in Fes on 30 November 1822. His reign began during a tumultuous time, when many noble families and rural tribal confederations in Morocco were trying to extract greater power away from the center, and spent much of the early part of his reign crushing revolts. 
Abd al-Rahman was tall and tanned, he was firm in his stance despite his advanced age, and wore simple clothes. Every day, he rode a horse to his garden in Agdal, situated near the gates of Fes. 
The will of Moulay Sulayman to entrust the throne to Abd al-Rahman:
 ;templatestyles src="Template:Blockquote/styles.css" / ;I do not think that the children of Mawlana, the grandfather Abdallah, nor the children of Moulay, my father, may God have mercy on him, nor the children of his children, are better than my master Abd al-Rahman ibn Hisham, and I am not better for this matter than him, because - God willing – may God protect him, he does not drink alcohol, does not commit adultery, does not lie, and does not betray. He does not take blood and money unnecessarily. And if the king of the two Easts reigns... and he fasts the obligatory and the supererogatory, and he prays the obligatory and the supererogatory. But I brought him from Essaouira for people to see and know him. And I took it out of Tafilalet to show it to them, because religion is advice. If the people of truth follow him, their affairs will be made right, as did Moulay Muhammad, his grandfather, and his father is alive. They never need me, and the people of Morocco will envy him and follow him, God willing. And whoever followed him followed guidance and light. And whoever follows others, he follows sedition and misguidance.
Reign.
Early reign.
Upon ascension, the sultan's finances were in shambles. With the country in disarray, the central government (the "Makhzen") was unable to collect much customary taxation. Abd al-Rahman turned to foreign trade, which had been cut off by the prior sultan, as a way to reap in customs revenue, and began to negotiate a series of trade treaties with various European powers.
Moulay Abd al-Rahman was an enthusiastic advocate of foreign trade. As governor of Essaouira he had encouraged European merchants, and after he became sultan, consul after consul trekked down to Marrakesh; the Portuguese in 1823, the British in 1824, the French and the Sardinian in 1825. Each signed a trade treaty, although Morocco had little to export because in 1825 the country began another cycle of poor rainfall and famine.
To recoup his expenses Moulay Abd al-Rahman decided to revive the institution of Barbary piracy and reestablish his corsairing fleet. In 1828 it captured some British ships and an Austrian one. This created confrontations with the British as they blockaded Tangier, and the Austrians bombarded Larache, Asilah and Tetouan in 1829. The final bombardment of a Moroccan city in retribution for piracy occurred in 1851 at Salé.
He was an adept leader and administrator and was able to build public works and infrastructure. He did however have to deal with internal conflicts and had to quell revolts many times: 1824–1825, 1828, 1831–1832, 1843, 1849, 1852, 1853, and 1857–1858. He was always successful at placating the nobles and malcontents though.
Expedition of Austria (1829–1830).
The navy of the Austrian Empire retaliated with force for the capture of their ship, the "Veloce", by the Moroccan corsairing fleet. The Austrians resolved to blockading the Moroccan ports, and then opened hostilities and bombarded Larache, Asilah and Tétouan. In June 1829 they landed at Larache and burned Moroccan ships. The Austrian landing at Larache frightened the Moroccan people on a general attack on the Muslims of North Africa, following when war started between the French and the Ottoman province of Algiers in 1827. However, the landing was a complete failure. In 1830, Austria concluded a treaty in which the principal condition was to offer a splendid gift to the sultan.
Invasion of Algiers (1830).
The most serious foreign threat to Morocco, however, was France, which had launched its invasion of neighboring Ottoman Algeria in 1830. The French landing at Sidi Feruj near Algiers and subsequent French victory in the Battle of Staouéli caused panic in Morocco, while Moroccans expressed solidarity with the Algerians. In the years preceding the French landing, in order to replace revenue lost through the demise of piracy, the Deys (the Ottoman-appointed heads of the Regency of Algiers) had raised taxes, turning the native population against them. The problem of mixed loyalties became even more acute after the French landing. As French forces pushed deeper into the interior, the tribes and city dwellers of the Province of Oran turned to Morocco for help. In the summer of 1830, Abd al-Rahman accepted boatloads of Algerian refugees arriving in the ports of Tangier and Tétouan, ordering his governors to find them housing and settle them into work.
Intervention in Tlemcen (1830–1832).
Shortly after Algiers fell in 1830, and fearing French invaders, Muhammad Bennouna organised a deputation to ask Moulay Abd al-Rahman to accept a "bay'a" from Tlemcen. The people of Tlemcen offered Abd al-Rahman the oath of allegiance that would legally establish 'Alawi rule over their region. The Sultan consulted the "'ulama" of Fez, who ruled that the inhabitants of Tlemcen had already sworn allegiance to the Ottoman Sultan and they could not change it now. In September 1830 the Tlemcenis sent another letter arguing that the authority of the Sublime Porte no longer existed, and that its former representatives had been irreligious tyrants. The notables of the beleaguered city kept pressuring for a Moroccan intervention, reminding Abd al-Rahman that the defense of Islam was the duty of the just ruler.
In October 1830 the sultan named his nephew Moulay Ali ben Slimane, who was only fifteen years old, as "Khalifa" of Tlemcen and sent him to take control of Tlemcen. An uncle of the sultan, Idris al-Jarari, the Governor of Oujda, was sent with him to help in protecting the city. The Moroccan troops were warmly welcomed, even in the provinces of Titteri and Constantine. The Moroccan Sultan's authority was speedily recognised in all parts of the regency. The "khotba", or public prayer, was pronounced in all the mosques for the Sultan of Morocco. Everything conspired to confirm the belief that Algeria had peaceably passed under the Moorish sceptre.
Moulay Ali let local rivalries continue unchecked, while his troops pillaged the countryside instead of taking the citadel of Tlemcen, still manned by Ottoman troops. In March 1831 the sultan recalled both of them and nominated the Governor of Tétouan Ibn al-Hami in their place. The Moroccan intervention in Algeria made it clear that the 'Alawi leadership could not orchestrate the popular feelings against the French to their own advantage. In January 1832 France sent an ambassador to Sultan Abd al-Rahman, demanding that he withdraw Morocco’s presence from Tlemcen. The Sultan initially refused to evacuate the city, but when a French warship appeared at Tangier the Makhzen negotiated and the sultan agreed to withdraw his troops. The Moroccan troops evacuated Tlemcen in May. But before Ibn al-Hami left, he appointed a new governor in the sultan's name. This was the local head of the Qadiriyya "tariqa", Muhyi al-Din, who began to organise resistance to the French. In November he handed the leadership to his son, Abd al-Kader. Another embassy was sent by the Marabouts and chiefs to Fez to implore the Moroccan Sultan to provide aid and assistance. Abd al-Rahman complied with their request, by sending a confidential agent to Mascara. This proceeding, however, produced no effect.
Wadaya Revolt (1831–1834).
As a result of the sultan's withdrawal from Tlemcen in March 1831, the Wadaya rebelled in the countryside of Morocco and recognised a relative of the sultan, Mohammed bin al-Tayyib, as sultan. The revolt began in the north and spread throughout Morocco, including the capital Fes, the sultan decided to leave Fes for Meknes which was safer and was protected by the 'Abid al-Bukhari infantry, but on the way to Meknes he was stopped by rebel troops who sent him back to Fes. After the sultan learned about the unpopularity of the chief minister, he dismissed him, took away his wealth, and gave it to the Wadaya as a generous bribe, but this did not stop the rebellion. A few months later, the sultan managed to escape Fes and settle in Meknes, where he slowly built the army there by recruiting more troops. With this army, he marched on Fes and besieged it for 40 days before the Wadaya surrendered in 1834. The sultan ordered the execution of the two most important leaders of the Wadaya revolt, and dispersed them from Fes to Marrakesh, Larache, and Rabat, ending their rebellion.
Support for Emir Abd al-Qadir (1832–1844).
Abd al-Rahman supported the continued guerrilla resistance in Algeria led by Abd al-Qadir al-Jaza'iri who was in theory, a vassal of the Moroccan sultan, albeit only tentatively, not wishing to incur French retaliation. But the border tribes of Morocco continued supporting Abd al-Qadir more actively, prompting the French launch their own strikes over the border and establishing forward outposts in Moroccan territory, which only inflamed the reaction in Morocco and increased the irregular border war. The Moroccan army attacked a French military group which France considered a declaration of war. After learning that the Sultan had sent huge forces to the eastern front, Peugeot gave Morocco a deadline of eight days to withdraw its armies from the east, but the Sultan was not convinced.
Franco-Moroccan War (1844), and aftermath.
The French then demanded that Morocco cease its support of Abd al-Qadir and cede its eastern frontier lands to French control and, in 1844, launched the First Franco-Moroccan War. The war did not go well for the sultan. The French navy bombarded Mogador (Essaouira) and Tangier, while the Moroccan army, under Abd al-Rahman's son Moulay Muhammad, was defeated by the French at the Battle of Isly in August 1844. Abd al-Rahman consented to the Treaty of Tangier in October 1844, withdrawing support for al-Qadir, and reducing border garrisons.
The treaties aggravated the internal situation in Morocco. Abd al-Rahman in fact rejected the Treaty of Lalla Maghnia at first, blaming it on his negotiators, but was eventually forced to ratify it. Army units and rural tribes across the north and east, already basically ungovernable, started raising rebellions which were only crushed with difficulty. The aftermath saw the break between Abd al-Rahman and Abd al-Qadir.
The crushing defeat at Isly and the bombardment of the Moroccan ports by the squadron commanded by the Prince de Joinville had grave consequences both for the sultan's internal authority and for his relations with Europe. The defeat of Isly sparked off tribal rebellions in many parts of Morocco. The Dukkala tribesmen in the region between Safi and El Jadida massacred government officials and looted El Jadida. Essaouira was pillaged by the tribes when its inhabitants deserted it. Rebellious tribes threatened Marrakesh, and in September 1845 Rabat rebelled and its leaders chose a local notable to replace the governor appointed by the sultan. The sultan's international standing was also weakened as a result of this defeat. The Scandinavian countries immediately ceased to make him the customary annual gift to retain commercial relations with Morocco. And the sultan, aware that much harm to the country could be avoided through speedy