- Lord Vishnu takes the Avatar of Vamana and seeks three feet of land from the king Mahabali, the grandson of Prahlad, who had dethroned Indra and usurped his powers. Bali agrees to donate the land.
- Vamana shows his true form and covers the earth in one step and covers the space in the second step. Bali, understanding that his ruling has come to an end, offers his head as the space for the third step.
- This vision has been captured in the image of Lord Vishnu in Tirukoilur. In one hand he can be seen showing two fingers stretched, while questioning Bali about the third step in the other. His right leg can be seen stretched to cover the sky or the entire universe.
- The temple is believed to have been built by the Medieval Cholas,a chieftain of Cholas, Ranakesari Raman is said to have built the Garbhagriha, Sukanasi and Mahamantapam in stone along with five Gopurams.
- Later contributions from Vijayanagar kings and Madurai Nayaks.
- The temple covers an area of 5 acres (20,000 m2) and has a temple tower that is the third tallest in Tamil Nadu, measuring 192 ft (59 m) in height.
- King Vira Rajendra Chola developed the temple complex further, states another inscription.
Pallava Dynasty: Inscriptions from the reign of Pallava king Nandivarman II (7th-8th century CE) mention the temple, suggesting its existence during this period. The Pallavas were known for their patronage of Hinduism and might have contributed to the temple's early structure.
Alvar Saints: The temple finds mention in the works of the Alvar saints, particularly the early Alvar saints like Pey Alvar, Bhoothathalvar, and Poigai Alvar, indicating the temple's importance as a Vaishnava pilgrimage site during the 6th-9th centuries CE.
Later Renovations: The temple complex has likely seen additions and renovations over the centuries. The current structure is believed to be a combination of contributions from various dynasties like the Cholas and the Vijayanagara Empire.