According to legends, the temple is said to have been built by Sibi Chakravarthy, king of Ayodhya in Treta Yuga 15 lakh years ago. This temple is older than Srirangam temple. The temple has three inscriptions in its two rock-cut caves, two dating from the period of Nandivarman II (732-796 AD) and the other to that of Dantivarman (796-847). It also has Pallava sculptural depictions of Narasimha and Varaha, two of the ten avatarss of Vishnu.