None of the ancient monuments of the city have caused as many puzzles for archeologists and historians as this one. The name of the mosque itself indicates the approximate time of its construction: the first part of the name, “Magoki”, means “pit” or “hole” and suggests that the mosque stood much lower than the present level of the city streets and squares.
Ancient Bukharans worshipped fire; they professed Zoroastrian religion. Each family had its own idol, and thought if they prayed to the idols, they would receive happiness and richness. These idols were sold twice a week at the bazaars. Mokh was the king of that time and he himself controlled the marketing. In order to develop trade in the city, he ordered the construction of a temple for the fire-worshippers.
During the excavations led by a great scientist, V. Shishkin, the remains of two buildings were found: the first one was the ancient Zoroastrian temple, and the second, above the Mosque, named “Magoki-Attori”. The Mosque was rebuilt in the 12th century, but only the southern facade and portals remain till now. An earthquake destroyed the Mosque in 1860 and the double dome collapsed; it was rebuilt in the 20th century.