Religion in Nagorno-Karabakh comprises different religious trends spread among the people and ethnic groups residing in the country. There are several confessions in Nagorno-Karabakh region.
Arrival of Islam
During Safavid Dynasty
In the sixteenth century, the first shah of the Safavid Dynasty, Ismail I (r. 1486-1524), established Shi'a Islam as the state religion, although a portion of people remained Sunni. As elsewhere in the Muslim world, the two branches of Islam came into conflict in Azerbaijan. Enforcement of Shi'a Islam as the state religion brought contention between the Safavid rulers of Azerbaijan and the ruling Sunnis of the neighboring Ottoman Empire.
During Russian Empire
In the nineteenth century, many Sunni Muslims emigrated from Russian-controlled Azerbaijan because of Russia's series of wars with their coreligionists in the Ottoman Empire. Thus, by the late nineteenth century, the Shi'a population was in the majority in Russian Azerbaijan. Antagonism between the Sunnis and the Shi'a diminished in the late nineteenth century as Azerbaijani nationalism began to emphasize a common Turkic heritage and opposition to Iranian religious influences.
In 1806, Azerbaijan was conquered by the Russian Empire.
During Azerbaijan Democratic Republic
In 1918, Azerbaijan declared independence from Russia, but was incorporated into the Soviet Union in 1920.
During Soviet era
Before Soviet power was established, about 2,000 mosques were active in Azerbaijan. Most mosques were closed in the 1930s, then some were allowed to reopen during World War II. The Soviet rule promoted an Azerbaijani national consciousness as a substitute for identification with the world Islamic community.
In the 1980s only two large and five smaller mosques held services in Baku, and only eleven others were operating in the rest of the country. Supplementing the officially sanctioned mosques were thousands of private houses of prayer and many secret Islamic sects.
After collapse of USSR
During the collapse of USSR Nagorno-Karabakh War started and all Azerbaijani populations were deported by Armenian forces from Nagorno-Karabakh region.
See also List of mosques in Nagorno-Karabakh