In 1711, when Peter I of Russia went on a campaign with all his troops (80,000) to gain access to the Black Sea, he was surrounded by the army of the Crimean Khan Devlet II Giray, finding himself in a hopeless situation. And only the betrayal of the Ottoman vizier Baltacı Mehmet Pasha allowed Peter to get out of the encirclement of the Crimean Tatars. When Devlet II Giray protested against the vizier's decision, his response was: "You should know your Tatar affairs. The affairs of the Sublime Porte are entrusted to me. You do not have the right to interfere in them"". Treaty of the Pruth was signed, and 10 years later, Russia declared itself an empire. In 1736, the Crimean Khan Qaplan I Giray was summoned by the Turkish Sultan Ahmed III to Persia. Understanding that Russia could take advantage of the lack of troops in Crimea, Qaplan Giray wrote to the Sultan to think twice, but the Sultan was persistent. As it was expected by Qaplan Giray, in 1736 the Russian army invaded the Crimea, led by Münnich, devastated the peninsula, killed civilians and destroyed all major cities, occupied the capital, Bakhchisaray, and burnt the Khan's palace with all the archives and documents, and then left the Crimea because of the epidemic that had begun in it. One year after the same was done by another Russian general — Peter Lacy. Since then, the Crimean Khanate had not been able to recover, and its slow decline began. The Russo-Turkish War of 1768 to 1774 resulted in the defeat of the Ottomans by the Russians, and according to the Treaty of Küçük Kaynarca (1774) signed after the war, Crimea became independent and the Ottomans renounced their political right to protect the Crimean Khanate. After a period of political unrest in Crimea, Imperial Russia violated the treaty and annexed the Crimean Khanate in 1783.