It is now a huge well maintained temple, blessing all her devotees. From then on the kings of Tanjore endowed special attention on maintenance of this temple. As son as his blind daughter was brought o the temple she regained her eye sight. He consecrated the idol as per instruction. A great scholar called Sadashiva Brahmendrar helped him. It instructed him to build the body of Mariamman with the mud of the ant hill and fix over it the head that is buried there. He located the anthill with the help of a goatherd and started digging there. She assured him that she will solve his problem. That night Mariamman again came in his dream in the form of a small girl and told him about his location. His daughter was affected by small pox and lost her eye sight. In 1738 another Maratha king Thulaja was ruling Tanjore. After him, this temple again fell in to disuse. He located the statue and built a temple for Mariamman and started worshipping her. Venkoji rushed to Punnainallur and stated searching for Mariamman. That night Mariamman came in his dream and told that there was no necessity for him to come to Samayapuram as she herself is in Punnainallur, buried in an ant hill. Once he reached Samayapuram only at night.
He was a great devotee of Samayapuram Mariyamman. In the year 1680, Thanjavur was ruled by a Maratha king called Venkoji. But for reasons unknown this temple disappeared. When Chozhas were ruling Thanjavur, a Mariamman temple existed here. This temple located in Punnai Nallur, which is popularly known as Mariamman Kovil, Thanjavur and it is 5 km from Thanjavur Old Bus stand.Punnainallur is a small village near the city of Thanjavur. The temple is maintained and administered by the Hindu Religious and Charitable Endowments Department of the Government of Tamil Nadu. The Great saint Sadhasiva Brammendra swamy shaped the white-ant hill (Putru) into a form of Mariamman and also installed a powerful Chakra. Originally the Amman was in the form of white-ant hill (Putru). It is said that the daughter of Tulaja Raja (1729–35) of Tanjore, who lost her eyesight in an illness, regained it on offering worship at this temple.
Ī temple was constructed at the place and the idol installed and so the deity of this temple is known as Punnainallur Mariamman. The King lost no time in rushing to the spot indicated to him and recovered the idol from the jungle. In the year 1680, when the Maharashtra king Venkoji Maharaja Chatrapati (1676–1688) of Tanjore was on a pilgrimage at Samayapuram, where there is a famous temple dedicated to Kali, Mariamman appeared to the King in his dream and told him -that she (the idol) was in a forest of Punna trees at a distance of about 3 miles from Tanjore.