 The early Muslim rulers taxed Hindu pilgrims for the privilege to visit the Surya temple, and this provided these rulers an important source of revenue.The Surya temple was destroyed by Ismaili Shia rulers in the late 10th century, who built a mosque atop the site, abandoning the Sunni congregational mosque in Multan.This Ismaili Shia mosque atop the Sun Temple's ruins was then destroyed by the Sunni ruler Mahmud of Ghazni, the Surya temple was not rebuilt and an empty space left in place, actions that helped re-establish the importance of the Sunni mosque in Multan.