monarchy. Despite being one of the chief vassals of the Sasanian emperor, the Albanian king had only a semblance of authority, and the Sasanian marzban (military governor) held most civil, religious, and military authority. In the first half of the 7th century, Caucasian Albania, as a vassal of the Sasanians, came under nominal Muslim rule due to the Muslim conquest of Persia. The Umayyad Caliphate repulsed both the Sasanians and Byzantines from the South Caucasus and turned Caucasian Albania into a vassal state after Christian resistance led by King Javanshir was suppressed in 667. The power vacuum left by the decline of the Abbasid Caliphate was filled by numerous local dynasties such as the Sallarids, Sajids, and Shaddadids. At the beginning of the 11th century, the territory was gradually seized by the waves of Oghuz Turks from Central Asia, who adopted a Turkoman ethnonym at the time. The first of these Turkic dynasties established was the Seljuk Empire, which entered the area now known as Azerbaijan by 1067. The pre-Turkic population that lived on the territory of modern Azerbaijan spoke several Indo-European and Caucasian languages, among them Armenian and an Iranian language, Old Azeri, which was gradually replaced by a Turkic language, the early precursor of the Azerbaijani language of today. Some linguists have also stated that the Tati dialects of Iranian Azerbaijan and the Republic of Azerbaijan, like those spoken by the Tats, are descended from Old Azeri. Locally, the possessions of the subsequent Seljuk Empire were ruled by Eldiguzids, technically vassals of the Seljuk sultans, but sometimes de facto rulers themselves. Under the Seljuks, local poets such as Nizami Ganjavi and Khaqani gave rise to a blossoming of Persian literature on the territory of present-day Azerbaijan. The local dynasty of the Shirvanshahs became a vassal state of Timur's empire and assisted him in his war with the ruler of the Golden Horde Tokhtamysh. Following Timur's death, two independent and rival states emerged: Qara Qoyunlu and Aq Qoyunlu. The Shirvanshahs returned, maintaining for numerous centuries to come a high degree of autonomy as local rulers and vassals as they had done since 861. In 1501, the Safavid dynasty of Iran subdued the Shirvanshahs and gained its possessions. In the course of the next century, the Safavids converted the formerly Sunni population to Shia Islam, as they did with the population in what is modern-day Iran. The Safavids allowed the