Dagestan
At Derbent in southern Dagestan, the Caucasus foothills approach the Caspian so closely that Sasanian rulers built walls from the citadel down to the sea to bar the coastal passage. In 1813, Persia recognized Russian sovereignty over Dagestan in the Treaty of Gulistan, though many mountain communities governed themselves.
From the mountain village of Gunib, Imam Shamil surrendered to Russian forces in 1859, ending his long resistance to imperial expansion in Dagestan and Chechnya. In 1860, Russia established Dagestan Oblast with its administrative seat at Temir-Khan-Shura. An uprising spread through the highlands in 1877 while Russia was at war with the Ottoman Empire. In 1921, Dagestan became an autonomous republic within Soviet Russia. That year the Caspian Port of Petrovsk-Port took the name Makhachkala and became the republican capital.