In 1813, the Karabakh khanate, Georgia, and Dagestan passed to Imperial Russia by the Treaty of Gulistan in 1813, before the rest of Transcaucasia was incorporated into the Empire in 1828 by the Treaty of Turkmenchay), following the two subsequent Russo-Persian Wars of the 19th century. In 1822, Mekhti-khan escaped to Persia. In 1826, in Karabakh the Persian armies with which was and Mekhti-khan have intruded; but they could not grasp Shusha which was protected desperately with Russian and Armenians, and have been expelled by Russian general Madatoff (himself Armenian from Karabakh by origin). The Karabakh khanate was dissolved, and the area became part of the Caspian oblast, and then Elizavetpol governorate within the Russian Empire.