The temple was built in c. 1223–1224 CE by Polalva, a commander and minister of the Hoysala Empire King Vira Narasimha II.
According to a Hindu legend, a demon named Guha (or Guhasura) once lived in these parts and a considerable surrounding region, from Uchchangi Durga in the east, Govinahalu in the south, Mudanur in the west and Airani in the north was under his control.
Guha successfully appeased Hindu god Brahma with his penance and obtained a boon, by virtue of which, it would be impossible for either Hari (Vishnu) or Hara (Shiva) to singly kill him.
In order to overcome Brahma's boon and eliminate Guha, Vishnu and Shiva together took the form of Harihara (a fusion), came down to earth and killed the demon.
[4][5] The original tower over the shrine (Vimana) is missing and has been replaced in modern times with one of brick and mortar.