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 and Ulagalantha Perumal Temple, Kanchipuram.
As per another legend, the temple is believed to have originally been a Krishna temple. The temple name, Kovilur, refers to the original deity Gopalan, indicating Krishna. As per Brahmanda Purana sage Mrikandu heard about Vamana avatar of Vishnu and wanted to have a view of it. Brahma directed him to visit the place and perform penance.
The sage came to the place along with his wife Mithravathi to start the penance. The pair used to feed Brahmanas in their hermitage. To test their devotion, Vishnu appeared as a Brahmana and sought food from the pair. Since all food for the day were already given, Mithravathi was worried and prayed to Vishnu. All the vessels were full with food and she was able to feed the Brahman. Pleased by their devotion, Vishnu reappeared as Vamana - Thrivikrama form.
![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Ulagalantha_Perumal6.JPG/220px-Ulagalantha_Perumal6.JPG)
Legend showing Ulagalantha Perumal measuring earth and sky
It was originally under the rule of Malayaman Malayarayan chieftains [9] and later switched hands to Miladudaiyar and again went back to Malayaman Malayarayan chieftains. Both Miladudaiyars and Malayaman Malayarayan chieftains had direct relationship with the Medieval Cholas, with their princess Sembian Mahadevi daughter of Malavarayar marrying Gandaraditya and Vanavan Mahadevi marrying Sundara Chola and gave birth to Rajaraja I, the illustrious Chola king.
There are multiple inscriptions in the temple from Chola, Pandya, and Vijayanagara Empire indicating donations to the temple. An inscription from Rajendra Chola II indicates that the temple was called Thiruvidaikali Alvar temple. A chieftain by name Ranakesari Raman reconstructed the whole sanctum with granite as the old structure built of bricks developed cracks.
He also built five pinnacles, the veranda and the hall in front of it. Another inscription during the regime of Rajadhiraja Chola in 1171 CE indicates the donation of seven kalanju (a measure used in olden times) by a lady for the conduct of festivals of Vaikasi and Aippasi and also for the recitation of Tiruvaymoli sung by Nammmalvar in the temple.
The temple was originally made of bricks, but during the period of Virarajendra Chola (1063–70), a granite structure was developed. Narasimha Varma constructed the other shrines also in granite. The temple received benevolent contributions from most of the later Chola rulers like Rajadhiraja Chola (1018–1054), Rajendra Chola II (1051–1063) and other rulers of the region like Vikramapandiya, Koperujinga and Vijayanagara rulers like Saluva Narasimha Deva Raya (1485–1491) and Sadasiva Raya (1542–1570) as seen from the inscriptions in the temple.
The temple was expanded during the rule of the Vijayanagar kings and Nayaks. The temple was the fortress to the British during the Carnatic wars. It was also attacked during the days of the period of Hyder Ali.