The territory of Crimea, previously controlled by the Crimean Khanate, was annexed by the Russian Empire on 19 April [O.S. 8 April] 1783. The period before the annexation was marked by Russian interference in Crimean affairs, a series of revolts by Crimean Tatars, and Ottoman ambivalence. The annexation began many years of Russian rule in Crimea, which ended with the transfer of the territory to the Ukrainian Soviet Socialist Republic in 1954. Russia annexed Crimea for a second time in March 2014.
Before Russia defeated the Ottoman Empire in the Russo-Turkish War of 1768–74, the Khanate, populated largely by Crimean Tatars, had been part of the Ottoman Empire. In the Treaty of Küçük Kaynarca, which was the result of that war, the Ottoman Empire was forced to cede sovereignty over the Khanate, and allow it to become an independent state under Russian influence. Tatars in Crimea had no desire for independence, and held a strong emotional attachment to the Ottoman Empire. Within two months of the signing of the treaty, the government of the Khanate sent envoys to the Ottomans, asking them to "destroy the conditions of independence". The envoys said that as Russian troops remained stationed in Crimea at Yeni-Kale and Kerch, the Khanate could not be considered independent. Nevertheless, the Ottomans ignored this request, not wishing to violate the agreement with Russia. In the disorder that followed the Turkish defeat, Tatar leader Devlet Giray refused to accept the treaty at the time of its signing. Having been fighting Russians in the Kuban during the war, he crossed the Kerch Strait to Crimea and seized the city of Kaffa (modern Feodosia). Devlet subsequently seized the Crimean throne, usurping Sahib Giray. Despite his actions against the Russians, Russian Empress Catherine the Great recognised Devlet as Khan.