The original building was partially destroyed and converted into a mosque by Qutb - ud - Din - Aibak of Delhi in the late 12th century. According to a local legend, after defeating Vigraharaja 's nephew Prithviraja III in the Second Battle of Tarain, Muhammad Ghori passed through Ajmer. There, he saw the magnificent temples, and ordered his slave general Qutb - ud - Din - Aibak to destroy them, and construct a mosque -- all within 60 hours (that is, ​ 2 ⁄ days). The artisans could not build a complete mosque in 60 hours time, but constructed a brick screen wall where Ghori could offer prayers. By the end of the century, a complete mosque was built.
who built adhai din ka jhopra at ajmer
Qutb - ud - Din - Aibak of Delhi