|The temple here was
in existence during the four Yugas and was known by different names in each; (1)
Ratnapuram in Krita, (2) Vilvavanam in Treta, (3) Chambagavanam in Dwapara. And (4)
Mullaivanam or Malateevanam in Kali. It is also said that the Lingam (known as
Masilamaniswara or Akalanka Ratneswara) is a Swayambhu and is being worshipped by Devas
and other heavenly persons. It is supposed to be two thousand years old.
The legend goes to show that King Tondaiman of Tondaimandalam. (Now the
districts of Chittoor, North Arcot, Chingleput and Madras) was attracted by the precious
beams of Erukku wood possessed by his enemies, the Jain Chiefs called Kurumban and Kantan,
who had their strong fortress at Pullal. In order to vanquish his enemies, King Tondaiman
marched his army against them, but he experienced a setback. He attempted to retreat
through this place. While retreating, the elephant on which he was seated
got its legs enmeshed in a thick bush of Mullai creeper.