The Mahavinayak Temple is a place of mythological and historical importance. This temple was constructed by the kings of the Keshari Dynasty of Odisha during the 12th century.
Rati Devi, wife of Kamadev, is worshiped there for her devotion that led to the release of her husband from the curse of Lord Shiva. While she was praying to Lord Ganesh, five hands simultaneously stretched out toward her to receive her offering, putting her in a dilemma. She then prayed to Bramha who clarified that the five gods, Ganesh, Sun, Vishnu, Shiva and Durga, were pleased with her prayer and simultaneously stretched their hands to receive her offering. Kamadev was released thereafter, and that day a large granite stone emerged from the earth, containing the divine power of the five gods.
This place is also related to Mahabharat legends. The Baruna hill area was the capital of Yudhisthira. From this place, he left for heaven by handing the royal charges of his empire to a teli (an oilman whom he saw first before dawn) who later became the king. His palace was named Teligarh and the remains of his palace can still be seen on the opposite side of the temple. During the Mahabharat battle, mother Kunti also offered Golden Champa flower to Lord Shiva from this place for the victory of her sons.
It is also said that the detached head of Lord Ganesh fell at this location.