by the Caucasian Avars. During the Sassanian era, southern Dagestan became a bastion of Persian culture and civilization, with its center at Derbent. A policy of "Persianisation" can be traced over many centuries. Islamic influence During the Islamic conquests, the Dagestani people (region of Derbent) were the first people to become Muslims within current Russian territory, after the Arab conquest of the region in 643. In the 8th century Arabs repeatedly clashed with the Khazars. Although the local population rose against the Arabs of Derbent in 905 and 913, Islam was still adopted in urban centers, such as Samandar and Kubachi (Zerechgeran), from where it steadily penetrated into the highlands. By the 15th century, Christianity had died away, leaving a 10th-century Church of Datuna as the sole monument to its existence. Seljuk Turks In the second half of the 11th century, the Seljuk Turks took part of the region of Dagestan under their control. 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. Timurids The Timurids incorporated the region into their realm following the Mongols. Alternating Persian and Russian rule As Mongolian authority gradually eroded, new centers of power emerged in Kaitagi and Tarki. In the early 16th century, the Persians (under the Safavids) reconsolidated their rule over the region, which would, intermittently, last till the early 19th century. In the 16th and 17th centuries, legal traditions were codified, and mountainous communities (djamaats) obtained considerable autonomy. In the 1720s, as a result of the disintegration of the Safavids and the Russo-Persian War (1722–23), the Russians briefly annexed maritime Dagestan from the Safavids. The Russians could not hold on to the interior of Dagestan, and could only be stopped in front of Baku with the help of Ottoman forces under the command of Mustafa Pasha. With a treaty signed between Russia and the Ottoman Empire in 1724, aimed at dividing the territories of Safavid Iran between them, Derbend, Baku and some other places in the region were left to Russia. Dagestan briefly came under Ottoman rule between 1578–1606. The territories were however returned to Persia in 1735 per the Treaty of Ganja. Between 1730 and the early course of the 1740s, following his brother's murder in Dagestan, the new Persian ruler and military genius Nader Shah led a lengthy campaign in swaths of