As per Hindu legend, Bali was the grandson of Prahlada. King Mahabali, though an asura king, 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. Though he attained divine grace, he incurred blame of the society for the means of reaching divinity.
He is believed to have worshipped in the temple for relief. Since Bali worshipped Maani (young Brahmachari Vishnu) and was immersed in a kuzhi (hole), the place came to be known as Thirumaanikuzhi.
The image of Shiva in the vimana
The place was originally believed to the be worshipping place of Kochengat Chola, a prominent Chola king. During his time, a part of the place was constituted as Perumbalaponmeyaperumalnallur.
The original structure is believed to be existent from time immemorial, while the later additions are believed to have been built by Cholas, while the present masonry structure was built during the 16th century.
There are inscriptions from later Chola emperors like Rajaraja Chola I (985–1014), Kulothunga Chola I (1070–1120),[3] and Rajendra Chola III (1246–1279).
The inscription in the entrance of the temple are numbered 165 of 1902.