In 1812 the peace treaty was signed in Bucharest with the Russians. In 1813, with the help of Muhammed Ali Pasha, he defeated the Wahhabis, who desecrated the holy places and shrines in Mecca and Medina. 