The present-day temple structure was built over the remains of an older temple. The original temple is believed to have been built by an obscure king named Bhadrasen. It has been mentioned in the Avanti Khanda of the Skanda Purana.[4][2] Images of Shiva, Parvati, Vishnu and Ganesha belonging to the Paramara period (9th-13th century CE) have been recovered from the place.[5] The temple walls were once decorated with Malwa paintings. However, only traces of these paintings are visible now.[4]
The present-day temple structure shows Maratha influence. According to the local tradition, after the Maratha defeat in the Third Battle of Panipat (1761 CE), the Maratha general Mahadaji Shinde offered his pagri (turban) to the deity, praying for victory in his campaign to restore the Maratha rule in North India. After successfully resurrecting Maratha power, he carried out restoration of the temple.[6]