There lived in Kaviripoompattinam, the capital of Chola kingdom, a couple Sivanesar and Gnana Kamalambikai, staunch Shiva devotees. They had a son with the blessings of Lord Shiva named Tiruvenkadar, a Shiva devotee. He was in marine trade. When 16, he married Sivakalai. They had no children though years rolled by. Tiruvenkadar continued his prayers to Lord Shiva for a son.
There also lived a couple devoted to Lord Shiva, Shivasarumar and Susheelai to whom Lord Shiva Himself was born in the name of Marudavanar. As the couple spent all their days in the service of the Lord, they could not bring up the boy due to poverty also. Lord Shiva appeared in their dream and advised to give the boy in adoption to Tiruvenkadar. Lord advised Tiruvenkadar too in his dream to accept the boy. The adoption was carried as ordered by the Lord.
Marudavanar also followed the marine trade of his adopted father. Once, on his return from the trade, Marudavanar left a box to his mother and left the house. When Tiruvenkadar opened the box to see the earnings of the son, he was shocked to see only some cakes made of husk and a note reading, “even a broken needle would not accompany a soul during the last journey”.
Tiruvenkadar caught the lesson. He prayed to Lord Shiva seeking salvation and renounced his wealth and family life. Lord told him that he would get it at an appropriate time. Tiruvenkadar began his pilgrimage to Shiva shrines. As he was born in Kaviripoompattinam, he came to be known as Pattinathar. While at Kasi, he accepted Badragiri the king of the place as his disciple.
Both were staying in Tiruvidaimarudur for a while. Lord Shiva granted salvation to Badragiri there. When Pattinathar begged the Lord, He gave him a sugar cane and said that he would be getting his due when and where the sugar cane tastes sweet. After a long pilgrimage, finally, Pattinathar came to this place and found the sugarcane tasting sweet. He called people there and asked them to cover him with abowl. They did. He became a Shivalinga. The temple was built at this place then.