The Magoki-Attori Mosque in the city's centre is an example of an urban mosque in a residential quarter. The mosque was built on the site of the pre-lslamic Moh temple mentioned above. Excavations have revealed the fact that even under the Samanids there was a six-pier mosque, which apparently was also domed. However, it was rebuilt substantially in the twelfth century; the floor level was upgraded and the main facade received a new design that survives with little damage only. By the sixteenth century, the thickness of cultural layers had increased so much that mosque seemed to sink deep into the soil and its facade was unearthed only as a result of excavations carried out in the 1930s.
The facade of the mosque is asymmetrical. To the right it has a portal with a recessed vault, fringed with rectangular strips; the architectural decor is composed of covered bricks which form geometric shapes and tiles of carved terra-cotta bearing vegetation patterns. Carved terracotta is also used in decorating the pylons and the vaults of the arches, combined with vegetation patterns with inscriptions covered with blue glaze. All in all, the Magoki-Attori Mosque is an excellent example of Central Asian architecture during the Kara-khanid epoch.