It was during this period, between 1770 and 1780, that a magnificent old mosque, said to have been built by Mughal Emperor Shah Jahan in 1630, was converted into a gurdwara. The only major change was the demolition of its minarets. The gurdwara was named Mastgarh, this designation being commonly used for gurdwaras converted from mosques. Bhai Prem Singh of Hazur Sahib was appointed the first granthi. Gurdwara Mastgarh is on a high ground in the northeastern part of the town. The original prayer hall, under a high dome is used as the divan hall. The Guru Granth Sahib is seated in the centre in front of the mihrab.