As per Hindu legend, the temple was called Brahma Putram in Satya Yuga, Parasaram in Treta Yuga, Sainthiranagaram in Dvapara Yuga and Bhargavapuram in Kali Yuga. The temple is associated with Trivikrama avatar of Vishnu. As per the legend, Sukrachariyar, the demon guru, was against king Mahabali donating land to Vishnu in the form of a Brahmin.
He took the form of the insect and shut the tube of the jug used by the king to spill water during the donation. Vishnu identified the trick and injured the eyes of the insect with a small spear. Sukracharyar, who lost his eyes, did penance at this place to attain the lost eye. It is the believed the light he attained is still glowing at the temple as a lamp called Nethra Deepam. Sage Parasara is believed to have worshiped the presiding deity of the temple.
Image of the shrine
Once the architects of Devaloga, Viswakarma and Mayan had an argument on whose skill was superior. Brahma, the god of creation informed Mayan that Viswakarma attained betterment as he built Vaikunta, the abode of Vishnu on account of accomplishments in a previous birth. He also informed Mayan that to attain similar status, he has to identify and build an abode near the river Kaveri similar to Vaikunta.
Mayan inspected various places and finally identified Thiruvelliyangudi, where sage Markendeya was doing penance. He built a beautiful temple and its compound, which is believed to be the temple in modern times. Vishnu appeared as Sringara Sundaran (beautiful deity).