Islam arrived in the country during the 7th century, and in the 16th, Shia Islam was the country's state religion.
The rest of the population adheres to other faiths or are non-religious, although they are not officially represented. Among the Muslim majority, religious observance varies and Muslim identity tends to be based more on culture and ethnicity rather than religion; however, many imams reported increased attendance at mosques during 2003. The Muslim population is approximately 85% Shi'a and 15% Sunni; differences traditionally have not been defined sharply.
In 1806, Azerbaijan was conquered by the Russians. In 1918, Azerbaijan declared independence from Russia, but was incorporated into the Soviet Union in 1920.
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.
The country's biggest mosque is the Friday Mosques in Shamakhi.