Topgaraghaj Mosque was built between 1899 and 1902 in the Topgaraghaj neighborhood of Shaki city. Its interior area is 24 × 12 meters, and the veranda area is 24 × 4.5 meters. The mosque was constructed using baked brick and river stone.[1]
After the Soviet occupation in Azerbaijan, an official campaign against religion began in 1928.[2] In December of that year, the Central Committee of the Communist Party of Azerbaijan transferred many mosques, churches, and synagogues to the control of clubs for use in educational purposes.[3] While there were 3,000 mosques in Azerbaijan in 1917, this number dropped to 1,700 in 1927, to 1,369 in 1928, and to just 17 by 1933.[3][4] During this period, the Topgaraghaj Mosque was also closed for worship. The mosque building was used as a warehouse and sewing workshop.[1]
After Azerbaijan regained its independence, both the mosque and a madrasa operating within it resumed activity.[1] The mosque was included in the list of immovable historical and cultural monuments of local significance by Decision No. 132 of the Cabinet of Azerbaijan dated August 2, 2001.[5] In 2018, the mosque was again closed for worship.[6]