the temple was very popular in the second chera dynasty. after the fall of the cheras, the place came under several rulers, the thekkumkur and travancore kings were prominent, witnessed many brutal wars, treachery, murder and annihilation. however, in all these cases, the temple was saved from destruction by the will of god and the prayers of the devotees. the legend behind this concept is that chera king palli bana perumal, when de-throwned by the bhattas (learned brahmins) following a defeat in argument, traveled to neelamperoor. the news came to the ears of the potti leaders of the pathu illams (chengazhi muttam, kainikkara, eravi mangalam, kunnithidasserry, athrasserry, kolencherry, kizhangazhuthu, kannancherry, thalavana etc.), that the king is going to install his own personal idol at neelamperoor. the potti leaders of the pathu illams thus managed to run with the idol of neelamperoor shiva and install it at vazhappally.