Religion in Nagorno-Karabakh is characterised by a largely homogeneous Armenian Apostolic population, with a minor population of Atheism. Prior to the Nagorno-Karabakh conflict a large population of Sunni Islamic Azeris also populated the area.
In the sixteenth century, the first shah of the Safavid Dynasty, Ismail I (r. 1486-1524) established Shia Islam as the state religion. The Safavid Dynasty would have a strict policy of enforcing Shia Islam, which would bring political conflict with the Sunnis of the neighbouring Ottoman Empire.
In 1806, Northern Azerbaijan was annexed by the Russian Empire from the Persian Qajar Dynasty, this region also included Nagorno-Karabakh.
During the Soviet era, state atheism was enforced, which resulted in all of Nagorno-Karabakh's Churches and Mosques being closed.
After the collapse of USSR, the Nagorno-Karabakh War began. During which most of the local Sunni Azeri population was deported by Armenian forces back to Azerbaijan. The Azeri's which had stayed soon after emigrated back to Azerbaijan.