The mosque was erected by order of Tamerlane after his victorious campaign in India. Construction began in May 1399. The location of the future mosque was chosen by Amir Timur himself. Craftsmen from various countries were involved in the construction: India, Iran, Khorezm, the Golden Horde. By September 1404, the main part of the complex had already been built. In the courtyard of the mosque, 10 thousand people could pray at the same time. According to legend, the mosque got its name in honor of the beloved wife of Tamerlane.