In the middle of the 17th century the cathedral mosque of Bibi-Khanym lied in ruins and Samarkand needed a new mosque. Yalangtush-biy ordered to construct it on Registan. The mosque was expected to serve as a madrasah too. It was under construction for almost twenty years and was finished in 1660. The gilding mass on the dome, walls and mihrab was more then on every famous buildings in Central Asia. Owing to that, the madrasah was called Tillya-Kari that means "gilt". The dome of the mosque remained unfinished till the 20th century. At the same time the lost facing was restored.