The Republic of Azerbaijan is the successor state to the ancient Christian country of Caucasion Albania, a nation close culturally and linguisticly to Armenia. However, due to numerous invasions by Muslims (Arabs, Turks, and Persians), the Albanians became assimilated into their culture and ultimately Islamified. During the late 20th century and early 21st century, Azerbaijan's heavy cultural identification with the Turks and the Nagorno-Karabakh conflict have made them bitter foes with Armenia.
Initally, Azerbaijan was a Christian state known as Caucasian Albania, or in Armenian Aghvan. Their church followed the same branch of Christianity as the Armenian Church, and they used the same alphabet. The Albanians shared a close friendship with the Armenians.
In the 7th and 8th centuries, Islam spread quickly spread throughout the region following the Arab conquests in the 7th–8th centuries. In the 11th century, the conquering Seljuk Turks invaded and became the dominant force in Albania. On the lowlands, the Turkic conquers began to assimilate the local population, who slowly adopted the language and religion of the Turks. In the mountains, pockets of Christians remained, and the Albanian Church remained intact until the 1800s, when the Russian rulers abolished the Albanian Church and what remained was absorbed into the Armenian Church. Today roughly 6,000 of the remaining un-Islamified ethnic Albanian Udi-speaking people still live in Azerbaijan, in particular the Nich village of the Gabala rayon. In the 13–14th centuries, the country experienced Mongol-Tatar invasions and from the the 15th to 18th centuries was was absorbed into the Persian Empire, a move that had a great cultural and religious impact on the Azeris (Shi'a Islam as opposed to the Sunni sect practiced today in Turkey became their dominant religion). Following the two wars fought between Peria and Imperial Russia, Azerbaijan was ceded to Russia in the Treaty of Gulistan in 1813, and the Treaty of Turkmenchay in 1828. The cession is still considered one of the greatest territorial defeats of Persia, and is still resented somewhat by older generations of Perians living in modernday Iran.
Today there are thought to be perhaps 15,000 Armenians remaining in Baku after most fled in the early 1990s following anti-Armenian pogroms. Those remaining are almost exlusively cases of mixed marriages, usually where the wife is Armenian and the husband Azeri.