As per Hindu legend, a son of Brahma named Karthama Prajapathi did penance worshipping Vishnu to attain Moksha. Vishnu was not pleased and Lakshmi, his consort, wanted to give Moksha to him immediately. During Kali Yuga, Karthama was born as prince named Sangabalan. During his young age, he wanted to marry Kumudavalli, who was an ardent devotee of Vishnu. She stipulated that she would marry him only if he feeds thousand devotees of Vishnu. Sangabalan started feeding the devotees and at one point, when he was short of money, resorted to burglary.
Vishnu came with Lakshmi incognito and Sangabalan tried to rob them as well. Vishnu uttered the Ashtatra Mantra in his ears and he turned into Thirumangai Azhwar. It is believed that Thirumangai Azhwar worshipped five Narasimhars including this one. The temple is also called Lakshmi Narasimha Kshetram and Vayalali Manavalan temple. Another variant states that the Vishnu directed his wife Lakshmi to be born as the daughter of sage Purna so that he can grace both her and Thirumangai Azhwar together.
Image of Narasimha slaying Hiranyakasipu, Prahlada is also seen praying
As per another legend, Vishnu took the avatar of Narasimha to slay the demon king Hiryankasipu. Hiranyakasipu was troubling the Devas as he got a boon from Brahma that no human can kill him. His son Prahlada was an ardent devotee of Vishnu, against the likes of his father. Hiranyakasipu tried to slay Prahlada by various means, but was saved by the divine grace of Vishnu.
Vishnu took the avatar of Narasimha and appeared from a pillar. Narasimha was a human with lion face and slayed Hiranyakasipu on an evening time in a doorway, which was neither land nor air. His anger was not quenched even after slaying the demon king and Lakshmi came and sat on his lap, after which he calmed down. It is believed that since Narasimha did an aalinganam (meaning hug), the place came to be known as Thiruvali.
The uniqueness of this temple is that Lakshmi is seen sitting in right side of Narasimmar which is very rare to have darshan as in most temples Lakshmi is seen in left side of swamy Narasimmar. Ahishekam in swathy star day gives very good blessings of the divine couple.
Shrine of Azhagiyasingar
The exact history of the temple could not be ascertained. It is believed to have been built by the Cholas, with later additions by the Vijayanagar and Thanjavur Nayak kings. Azhagiyasingar temple is revered in Nalayira Divya Prabhandam, the 7th–9th century Vaishnava canon, by Kulasekara Azhwar and Thirumangai Azhwar.
The temple is classified as a Divyadesam, one of the 108 Vishnu temples that are mentioned in the book. The songs of the Azhwars refer both this temple and the Thirunagari temple and hence both are counted as one Divya Desam.During the 18th and 19th centuries, the temple is mentioned in 108 Tirupathi Anthathi by Divya Kavi Pillai Perumal Aiyangar.
The temple is maintained and administered by the Hindu Religious and Endowment Board of the Government of Tamil Nadu.The temple is the capital of Thirumangai Azhwar, who was the ruler of a kingdom and also the birthplace of Kumudavalli, the wife of Azhwar.