The destabilisation of the Ottoman Empire through internal issues, Russian expansionism in the Caucuses and Balkans not to mention direct French intervention in Egypt and Syria between 1798-1801 created opportunities for ambitious leaders like Muhammad Ali Pasha and Saud Al Kabeer (the great) to carve out nations from the flesh of the empire.
In 1811 the Ottoman Sultan Mahmoud II ordered Muhammad Ali Pasha (the supposed Wāli in Egypt) to redouble efforts to pacify Arabia, where in 1802 the House of Saud had gone on a conquering spree under the expansionist, Saud bin Abdulaziz Al Saud (Al Kabeer) Emir of Diriyah netting the holy city of Mecca as a prize.
Though ostensibly on the job since 1807, Ali had other things on his mind than fighting in Arabia, (such as massacring Mamelukes to secure his power-base) but he was content to let Istanbul believe the fiction of Egyptian fealty. He dispatched his son Tusun Pasha with 10,000 men, but Saud Al Kebeer defeated him at Al-Safra in 1812.
Despite stubborn Saudi resistance, Tusun Pasha was reinforced with another 10,000 men & was able to recapture Al Medina and Mecca. The Saudi Emir then died in 1814. Tusun was also ailing and agreed to a treaty with Abdullah bin Saud in which Hijaz was surrendered & vassalage offered.
Neither Ali nor the Sultan ratified the treaty with the House of Saud. In 1816 Tusun Pasha died and with mutual distrust rampant, the war resumed with Ali’s other son, Ibrahim Pasha taking command & driving the Saudi Emir and his fanatical “Wahhabis” (more properly Salafis) into the desert of Nejd.
Ibrahim Pasha was leading a reinvigorated Egyptian army, newly reformed and reorganised against the Emirate’s Wahhabi die-hards. The “Wahhabi’s” being adherents of Muhammad ibn ʿAbd al-Wahhab, a Sunni scholar who wanted to reform what he saw as Islam’s decedent devotion to saints and rituals. His puritanical followers dealt harshly with their “unclean” Co-religionists as a result and the objection to the veneration of Muslim saints extended to banning the name of the Ottoman sultans in Friday prayers. The Saud Emirs of Diriyah were the greatest champions of Abd al-Wahhab’s teachings.
Therefore, nothing short of totally subjugation would be tolerated by Istanbul & Cairo, after Wahhabi, massacres, desecrations of orthodox holy sights and direct insults to the Sultan.
In 1818 Ibrahim brought his forces, now swollen to 30,000 men to the gates of Diriyah, having marched across the desert and ruthlessly massacring the male population of Dhurma to sap the heart of the rebels. However, the great fortress held out for six months with huge loss of life on both sides.
Outnumbered & starving, the Wahhabi defenders surrendered Diriyah on 9 Sept. Abdullah bin Saud was taken to Cairo & protected for a time, but despite promises to spare the the city, Diriyah was sacked, & the emir himself was reluctantly sent to Istanbul & beheaded in 1819.
The fall of the Diriyah Emirate also known as the 1st Saudi State, brought an end to the period of Sunni Islamist “Wahhabi” expansionism though did not wipe it out & neither the faltering power of the Sultan nor the rising power of Egypt managed to assert dominance over Arabia, and the Saudi state would rise again.