Legend holds that this temple is the place where Shiva destroyed three rakshashas and the three cities created by them. Saranarayana Perumal, another name of Vishnu, is the one who gave the arrow to Shiva for killing the demons, whose temple is also located in the town, little easterly. Shiva Purana details the legend of destruction of the demon Tripuran, who was ruling Tripura. The destruction is detailed as a cosmic event, which most attribute to the destruction of stars, meteors and unexplained material bodies. Tripuran attacked all the celestial deities who sought the help of Shiva to protect them. Shiva after a fiery fight, destroyed Tripuran and attained the name Tripurantaka. Shiva ashed down the city Tripura and dipped his three fingers in the ashes, which signifies the three lines of ash which is worn by all shaivites on their forehead.