The Azerbaijanis are believed to be inheritors of various ancient civilizations and peoples including the indigenous Caucasian Albanians, Iranian tribes such as Scythians and Alans, and Oghuz Turks among others (note that several modern peoples of the Caucasus can trace their ancestries to more than one of these same ancient peoples).
The country location in the crossroads of Europe and Asia and made it possible for Azeris to have military contact both with European and Oriental forces.
Caucasian Albanians are believed to be the earliest inhabitants of Azerbaijan. Early invaders included the Scythians in the 9th century BCE. The South Caucasus was eventually conquered by the Achaemenids around 550 BCE. During this period, Zoroastrianism spread in Azerbaijan. The Achaemenids in turn were defeated by Alexander the Great in 330 BCE. Following the decline of the Seleucids in Persia in 247 BCE, an Armenian Kingdom exercised control over parts of modern Azerbaijan between 190 BCE to 428 CE. Caucasian Albanians established a kingdom in the 1st century BCE and largely remained independent until the Sassanids made the kingdom a province in 252 CE. Caucasian Albania's ruler, King Urnayr, officially adopted Christianity as the state religion in the 4th century CE, and Albania would remain a Christian state until the 8th century. Sassanid control ended with their defeat by Muslim Arabs in 642 CE.
Muslim Arabs defeated the Sassanids and Byzantines as they marched into the Caucasus region. The Arabs made Caucasian Albania a vassal state after the Christian resistance, led by Prince Javanshir, surrendered in 667. Between the 9th and 10th centuries, Arab authors began to refer to the region between the Kura and Aras rivers as Arran. During this time, Arabs from Basra and Kufa came to Azerbaijan and seized lands that the indigenous peoples had abandoned; the Arabs became a land-owning elite. Despite pockets of continued resistance, the majority of the inhabitants of Azerbaijan converted to Islam. Later on in the 10th and 11th centuries, Kurdish dynasties of Shaddadid and Rawadid ruled parts of Azerbaijan.