The town was founded after the Second Battle of Tarain (Taraori) in 1192 by a general of Shahab-ud-din Muhammad Ghuri. Historically it was a Muslim majority town, with references made to a fort during Mughal times, and raids as well as sacking of the fort by Banda Singh Bahadur. It was pillaged by Babur for having rendered assistance to Ibrahim Lodhi. Significantly it also has a historic gurdwara of those times and many temples including Shri Markandeshwar Mahadev Shiv Mandir, Balasundri Mandir, Durga Mandir. After partition most of the Muslims left, and Punjabis, Sikhs and Hindus from Pakistan were resettled here.