As per Hindu legend and the Sthalapurana, Shiva was worshipped by Agni, the fire god at this place and the presiding deity came to be known as Agnipureeswarar and the temple tank is called Agni theertham. As per another legend, Bhudevi, the consort of Vishnu wanted to install a Linga and worship Shiva. Banasura, her son, is believed to have dug the Linga at the place, but could not lift it. The lingam in the place is believed to appear tilted (called Konapiran) on account of it. Shiva was pleased with the devotion of Bhudevi and appeared in his dancing form in front of her. It is also believed to be the place where Shiva turned bricks into gold for the Nayanar Sundarar.