Here, the Oghuz tribes divided into various smaller groups, some of whom – mostly Sunni – moved to Anatolia (i.e., the later Ottomans) and became settled, while others remained in the Caucasus region and later – due to the influence of the Safaviyya – eventually converted to the Shia branch of Islam.The latter were to keep the name "Turkmen" or "Turcoman" for a long time: from the 13th century onwards they gradually Turkified the Iranian-speaking populations of Azerbaijan (historic Azerbaijan, also known as Iranian Azerbaijan) and Shirvan (Azerbaijan Republic), thus creating a new identity based on Shia and the use of Oghuz Turkic.The Arabs made Caucasian Albania a vassal state after the Christian resistance, led by Prince Javanshir, surrendered in 667.Conversion to Islam was slow as local resistance persisted for centuries and resentment grew as small groups of Arabs began migrating to cities such as Tabriz and Maraghah.The formation of the Azerbaijan Democratic Republic in 1918 established the territory of the Republic of Azerbaijan.The Azerbaijani language is closely related to Turkish, Qashqai, Gagauz, Turkmen and Crimean Tatar, sharing varying degrees of mutual intelligibility with each of those languages.Certain lexical and grammatical differences formed within the Azerbaijani language as spoken in the Republic of Azerbaijan and Iran, after nearly two centuries of separation between the communities speaking the language; mutually intelligibility, however, has been preserved.
Russia loomed as a threat to Persian and Turkish holdings in the Caucasus in this period.
Today, this Turkic-speaking population is known as Azerbaijani.
Ancient Iranian people of the Medes forged a vast empire between 900 and 700 BC, which the Achaemenids integrated into their own empire around 550 BC.
Following the decline of the Seleucids in Persia in 247 BC, an Armenian Kingdom exercised control over parts of Caucasian Albania.
Caucasian Albania's ruler, King Urnayr, went to Armenia and then officially adopted Christianity as the state religion in the fourth century AD, and Albania remained a Christian state until the 8th century. Muslim Arabs defeated the Sassanids and Byzantines as they marched into the Caucasus region.