In the 11 th Century king Ukkirapandia ruled over Ukkirankottai. He used to go over to Madurai for dharsan of Lord Arulmigu Somasundarar. One day when he was priceeding to Madurai for worship God Arulmigu Somasundarar, The Elephant tusked the earth on the way and plunged into a pit. At that time Manikireevan, the watchman of Punnai forest came there and told the king “Oh king! Here is an anti-hill in the middest of Punnai forest.When the anti-hill was demolished there appeared a tail less cobra. It's might is unexplainable. It belongs to the god. On hearing this the king rushed to the Punnai forest and saw the Sivalingam by the side of the ant- hill to his over whelming happiness. Then he had a bath in the Nagasunai (holy tank) and worshipped the God. Later on according to history, the king destroyed the forest in the vicinity of the ant – hill, constructed this Temple with Mandapams, Gopuram (Tower) and Compound walls. In the 12 th Century king Seevalaramapandian constructed the Rajagopuram (big tower) and front Mandapam. This temple has three important sannadhis with in its premises.