Gurdwara Mastgarh is located in Shahabad or Shahabad Markanda, 20, kilometers south of Ambala Cantonment along the Grand Trunk Road (now Sher Singh Suri Marg). Shahabad Markanda is an old town, which Banda Singh Bahadur pillaged in 1709. When the Sikh misls, after the conquest of Sirhind in 1764, started occupying territories permanently, Shahabad and its surrounding area came under Sardar Mehar Singh of the Nishananwali Misl.
Masjid converted to a Gurdwara
The principal mosque of the city was said to have been built by the Mughal emperor Shah Jahan in 1630. It was converted into a Gurdwara by demolishing its minarets, hoisting the Nishan Sahib (Sikh flag) over it and installing Guru Granth Sahib inside it. The domes and mehrab remained intact. It was given the name Gurdwara Mastgarh. Bhai Prem Singh from Hazur Sahib (Nanded) was its first granthi.
In the beginning of the nineteenth century, the entire area from Delhi to Ambala and Ludhiana became a part of British dominions. The population of Shahabad remained predominantly Muslim until 1947, when the Muslims who headed for safety in Pakistan were replaced by Hindu and Sikh migrants fleeing to India and the safety of Shahabad Markanda.
Attendance of devotees at Gurdwara Mastgarh increased accordingly. The Gurdwara was affiliated to the S.P.G.C. and plans were made to reconstruct its building. A few years ago, when the work was taken in hand, trouble arose. The Gurdwara is on a high mound along which on the backside of the Gurdwara below the level of its plinth is a row of shops occupied mostly by Hindu migrants. They objected to the demolition and reconstruction of the shrine. But the matter has since been settled amicably and the Gurdwara reconstructed.