The temple finds mention in Brahmanda Purana as Patalika Vanam and Uttama Kshetram. As per Hindu legend, Brahma boasted about his long life. A sage called Romas wanted to suppress Brahma's thought and he did severe penance at this place. Vishnu was pleased by his devotion, and Vishnu appeared before him. On further request from the sage, Vishnu appeared again as Trivikrama. He gave a boon to the sage that he would get a life longer than that of Brahma and blessed that with each falling hair of the sage, Brahma would lose one year.
The Bhagavata Purana describes that Vishnu descended as the Vamana avatar to restore the authority of Indra over the heavens, as it had been taken by Mahabali, a benevolent Asura King. Bali was the grandson of Prahlada. King Mahabali was generous, and engaged in severe austerities and penance and won the praise of the world. With the praise from his courtiers and others, he regarded himself as the all powerful in the world. Vamana, in the guise of a short Brahmin carrying a wooden umbrella, went to the king to request three paces of land. Mahabali consented, against the warning of his guru, Sukracharya.
Vamana then revealed his identity and enlarged to gigantic proportions to stride over the three worlds. He stepped from heaven to earth with the first step, from earth to the netherworld with the second. King Mahabali, unable to fulfill his promise, offered his head for the third. Vamana then placed His Foot and gave the king immortality for his humility. In worshiping Mahabali and his ancestor Prahláda, he conceded sovereignty of Pátála, the netherworld.
Some texts also report that Vamana did not step into the netherworld, and instead gave its rule to Bali. In giant form, Vamana is known as Trivikrama. The legend is associated with Thrikkakara Temple in Kerala, but also with this temple, Ulagalantha Perumal Temple, Tirukoyilur and Ulagalantha Perumal Temple, Kanchipuram.
The shrines of the Andal and Loganayagi in the temple