People believe that during the Mahabharata period, the Pandavas spent some time of their exile here. During that time, Bhima built this temple. Since, Bhima's eldest brother Yudhishthira was also called Dharmaraj, this temple came to be known as Dharmarajeshwar Temple. It is said that there is also a huge cave here, which opens from this temple to Ujjain. The Archaeological Department has closed it.