As per Hindu legend, Vishnu wanted to propitiate the sins caused by slaying Mahabali during Vamana avatar. He prayed Shiva for the same at various Shiva temples. His sins were cleared while worshipping Shiva. There is an image of Vishnu in a sculpture showing the legend. As per another legend, Sambandar, the 7th century Saiva saint Nayanmar, visited the place and sung praises of Atulya Natheswarar. The temple was locked down earlier by Jain monks and was believed to have been brought to worship practises after Sambandar. He was planning to go to Tiruvannamalai, but was stopped by a divine force. He set up Annamalaiyar as Lingam in this place and started worshiping. It is believed that Samndar's foot steps are seen at the place and the Annamalaiyar Temple at Tiruvannamali can be viewed from the point. Arai indicates rock while ani indicates beauty - since Shiva appears beautifully over the rock, the presiding deity of the temple is called Araiyanitheeswarar, which is Sankritised version of Atulya Nadheswarar.