A legend says that after Goddess Sati sacrificed herself in the honor of Lord Shiva in her Fathers Yagya. Shiva took her body on his shoulder and started Tandav. In order to stop him from destroying the world Lord Vishnu divided the body of Sati into 51 parts with his Chakra. The left breast of Sati fell at this spot, thus making it a Shakti Peeth.
The original temple was built by the Pandavas at the time of Mahabharatha. Legend says that one day Pandavas saw Goddess Durga in their dream in which she told them that she is situated in the Nagarkot village and if they want them self to be secure they should make a temple for her in that area otherwise they will be destroyed. That same night they made a magnificent temple for her in the Nagarkot village.
This temple was looted a number of time by the Muslim invaders. Md Gaznavi looted this temple at least 5 times, in the past it used to contain tonnes of gold and many ghantas made of pure silver. In 1905 the temple was destroyed by a powerful earthquake and was subsequently rebuilt by the government.