History of Dagestan
Historically, Dagestan (partially ancient Albania) consisted of a federation of mountainous principalities in the eastern part of the North Caucasus. Located at the crossroads of world civilizations of north and south, Dagestan was the scene of clashes of interests of many states and until the early 19th century most notably that of between Persian Empire (Iran) and Imperial Russia.

The name

The word Dagestan is of Turkish and Persian origin, directly translating to "Land of the Mountains." The Turkish word dağ means "mountain", and the Persian suffix -stan means "land". Some areas of Dagestan were known as Lekia, Avaria and Tarki at various times.   
The name  Dagestan historically refers to the eastern Caucasus, taken by the Russian Empire in 1860 and renamed the Dagestan Oblast. 
The current, more autonomous Republic of Dagestan covers a much larger territory, established in 1921 as the Dagestan Autonomous Soviet Socialist Republic, by inclusion of the eastern part of Terek Oblast.

Sassanid Persian rule and Khazar invasions of 6th CE 

In the 6th century the Sassanid Empire after more than 100 years of war conquered the Eastern Caucasus, resulting in the entire region of Dagestan falling under the influence of Persia.

In 552, "Khazars" invaded North-Eastern Caucasus and occupied northern lowlands of Dagestan. Reigning Shah of Persia Khosrau I (531—579), to protect his possessions from the new wave of nomads, began the construction of defensive fortifications in Derbent, that closed a narrow passage between the Caspian Sea and Caucasian mountains. Khosrau I owned fortress Gumik. The modern name "Derbent" is a Persian word (دربند Darband) meaning "gateway", which came into use in this same era, in the end of the 5th or the beginning of the 6th century CE, when the city was re-established by Kavadh I of the Sassanid dynasty of Persia.

Ancient Iranian language elements were absorbed into the everyday speech of the population of Dagestan and the city of Derbent, especially during the Sassanian era, and many remain extant. A policy of "Persianizing" Derbent and the eastern Caucasus in general can be traced over many centuries, from Khosrow I to the Safavid shahs Ismail I, and Abbās the Great. According to the account in the later "Darband-nāma," after construction of the fortifications Khosrow I "moved much folk here from Persia," relocating about 3,000 families from the interior of Persia to Derbent and neighboring villages. This account seems to be corroborated by the Spanish Arab Ḥamīd Moḥammad Ḡarnāṭī, who reported in 1130 that Derbent was populated by many ethnic groups, including a large Persian-speaking population.

Arab invasions of 7th-8th CE 

Dagestan passed from Iranian to Arab rule following the Muslim conquest of Persia. This period is known by a 150 years of war that peoples of the northeastern Caucasus region fought between Arabs and Khazars. In 643, during the reign of caliph Umar ibn Khattab, Arab armies led by Abd al-Rahman ibn Rabi captured Derbent and the neighboring territories. In 652 Abd al-Rahman ibn Rabi was killed during the siege of Khazar city of Balanjar. In 662 the Khazars invaded Dagestan. In 698 Muhammad ibn Marwan, brother of caliph Abd al-Malik ibn Marwan, captured Derbent. In 705 Maslamah ibn Abd al-Malik, brother of caliph Al-Walid I, once again took over Derbent.

In 722, caliph Yazid II sent warlord al-Djarrah al-Hakami to defend the fortress of Derbent. Historian Al-Tabari recounts the campaigns of al-Djarrah thus: "Arabs defeating Khazars in southern Dagestan moved to the mountains of Dagestan, overcame the resistance of the people of Khamzin and Gumik, and in punitive expeditions ransacked Kaitag and Tabasaran for refusal to accept their authority."

Historian Balami writes that in 723 the warlord al-Djarrah "called one of his close commanders, gave him three thousand warriors and said to him, "Go to Kaitag, destroy there everything that you will meet on your way, fight everyone who will show you resistance and come back to me before the sunrise." In 723, Arab forces under the command of al-Djarrah moved through the territory of Dagestan and captured Balanjar. In 730 al-Djarrah was killed in the battle of Marj Ardabil.

In 730–731, Maslamah ibn Abd al-Malik, brother of caliph Hisham ibn Abd al-Malik, "fortified Derbent in the best possible way" by building seven iron gates, "and marched with his army to Kumukh". In 732, Marwan Ibn Muhammad, cousin of caliph Hisham, overcame powerful fortresses of mountainous Dagestan, forcing them to pay tribute. Ibn Hayyat, Iranian author of the ninth century, says that after the capture of "Gumik" and "Khunzakh," Marwan "went away from there, and entered the land of Tumen." According to Al-Balazuri, Marwan led an army of 120,000 into Khazar possessions. The Khazar army endured a series of defeats. Marwan captured the city of Samandar. In 797 the Khazars carried out an invasion of Dagestan.

Mongol rule 

 
The Mongols raided the lands in 1221-1222 then conquered Derbent and the surrounding area from 1236 to 1239 during the invasions of Georgia and Durdzuketia.

Persian domination and Russian conquest

In the early 16th century the Persians (under the Safavids) consolidated their rule over the region, which would last intermittently until the early 19th century. In the 16th and 17th centuries, legal traditions were codified and mountainous communities (djamaats) obtained a considerable degree of autonomy, while the Kumyk potentates (shamhals) asked for the Tsar's protection following the Russo-Persian War (1651–53) despite a Russian loss. The Russians tightened their hold in the region in the 18th century, when Peter the Great took maritime Dagestan in the course of the Russo-Persian War (1722–23) – although the territories were returned to Persia in 1735 per the Treaty of Ganja.

The 18th century also saw the resurgence of the Khanate of Avaristan, which even managed to repulse the attacks of Nadir Shah of Persia at a certain point during his Dagestan campaign and impose tribute on Shirvan and Georgia. From 1747 on, the Persian-ruled part of Dagestan was administered through the Derbent Khanate, with its centre at Derbent. The Persian Expedition of 1796 resulted in the Russian capture of Derbent. However, the Russians were later forced to retreat from the entire Caucasus due to domestic governmental problems, enabling Persia/Iran to recapture the territory.

In 1806 the khanate fell under Russian control, but it was not until the aftermath of the Russo-Persian War (1804-1813) that Russian power over Dagestan was confirmed when Persia formally ceded the territory to Russia. In 1813, following Russia's victory in the war, Qajar Persia was forced to cede southern Dagestan with Derbent, along withother territories in the Caucasus, to Russia under the Treaty of Gulistan. The 1828 Treaty of Turkmenchay indefinitely consolidated Russian control over Dagestan and removed Persia/Iran from the regional military equation.

Modern history

Imperial Russian administration disappointed and embittered the people of Dagestan. Heavy taxation, coupled with the expropriation of estates and the construction of fortresses (including Makhachkala), spurred highlanders into rising under the aegis of the Muslim Imamate of Dagestan, led by Ghazi Mohammed (1828–32), Gamzat-bek (1832–34) and Shamil (1834–59). This Caucasian War raged until 1864, when Shamil was captured and the Khanate of Avaristan was abolished.

Dagestan and Chechnya took advantage of the Russo-Turkish War (1877–78) to rise against Imperial Russia. On 21 December 1917 Ingushetia, Chechnya, and Dagestan declared independence from Russia and formed a single state titled the "United Mountain Dwellers of the North Caucasus," also known as the "Mountainous Republic of the Northern Caucasus."  The capital of this self-proclaimed country was moved to Temir-Khan-Shura, Dagestan. 
The first prime minister was Tapa Chermoyev a Chechen politician; the second prime minister was an Ingush politician Vassan-Girey Dzhabagiev, who also was the author of the constitution of the land in 1917. In 1920 he was reelected for the third term.

Following the Bolshevik Revolution in October 1917, Ottoman armies occupied Azerbaijan and Dagestan and the region became part of the short-lived Mountainous Republic of the Northern Caucasus. After more than three years of fighting in the Russian Civil War, the Bolsheviks (Communists) achieved victory and the Dagestan Autonomous Soviet Socialist Republic was proclaimed on January 20, 1921. Nevertheless, Joseph Stalin's industrialization largely bypassed Dagestan and the economy stagnated, making the republic the poorest region in Soviet Russia.

In 1999, an Islamist group from Chechnya, led by  Shamil Basayev and Ibn Al-Khattab, launched a military invasion of Dagestan, with the aim of creating an "independent Islamic State of Dagestan". The invaders were driven back to Chechnya by the Russian military. In retaliation, Russian forces reinvaded Chechnya later that year. Dagestan underwent a rise in Islamic militancy in the early 2000s. Violence in the Republic occurred  in 2010–2012. This upsurge led some people to fear that Dagestan was about to enter into a sectarian civil war. Dagestan became the epicenter of violence in the North Caucasus with Makhachkala, Kaspiisk, Derbent, Khasavyurt, Kizlyar, Sergokala, Untsukul, and Tsumada all becoming hotbeds of militant unrest.

See also
 Timeline of Makhachkala

References 

 
History of Derbent