Jews have lived in Azerbaijan for centuries. Ashkenazim settled in Azerbaijan in the 19th century during a Czarist Russian attempt to infuse Russian culture into the region. Other Ashkenazim came to Azerbaijan during World War II to escape the Nazis. The Persian Jews, also known as Caucasian Mountain Jews, can be traced to Azerbaijan from before the 5th century. Their history is more than 2,000 years long and Azerbaijan has historically been very welcoming toward them.
The first religious meeting-house in Baku was built in 1832 and was reorganized into a synagogue in 1896; more synagogues were built in Baku and its suburbs in the late 19th century. The first choir synagogue in Baku opened in 1910. In 2017, there were seven synagogues in Azerbaijan: three in Baku, two in Qırmızı Qəsəbə near Quba, and two in Oğuz.
The various groups of Jews in Azerbaijan are: Mountain Jews, Azerbaijan Jews, Ashkenazi Jews and Georgian Jews. Azerbaijan at one point was or still is home to smaller communities of Krymchaks, Kurdish Jews and Bukharian Jews, as well Gerim (converts) and non-Jewish Judaistic groups like Subbotniks.
For centuries Krasnaya Sloboda, perhaps the only completely Jewish settlement outside Israel, kept its traditions intact, surrounded by Muslims. The fall of the Soviet Union, however, in 1991 prompted a mass exodus from here and from Baku. In recent years the population has plummeted as inhabitants pack their bags for Israel, America and Europe.