Suleyman's successor, Abd al-Rahman (or Abderrahmane; ruled 1822–1859), tried to reinforce national unity by recruiting local elites of the country and orchestrating military campaigns designed to bolster his image as a defender of Islam against encroaching European powers. The French conquest of Algeria in 1830, however, destabilized the region and put the sultan in a very difficult position. Wide popular support for the Algerians against the French led Morocco to allow the flow of aid and arms to the resistance movement led by Emir Abd al-Qadir, while the Moroccan "ulama" delivered a fatwa for a supporting jihad in 1837. On the other hand, Abd al-Rahman was reluctant to provide the French with a clear reason to attack Morocco if he ever intervened. He managed to maintain the appearance of neutrality until 1844, when he was compelled to provide refuge to Abd al-Qadir in Morocco. The French, led by the marshall Bugeaud, pursued him and thoroughly routed the Moroccan army at the Battle of Isly, near Oujda, on August 14. At the same time, the French navy bombarded Tangiers on August 6 and bombarded Mogador (Essaouira) on August 16. In the aftermath, Morocco signed the Convention of Lalla Maghnia on March 18, 1845. The treaty made the superior power of France clear and forced the sultan to recognize French authority over Algeria. Abd al-Qadir turned rebel against the sultan and took refuge in the Rif region until his surrender to the French in 1848.