With the legend of the smiling infant, James Emerson Tennent describes "one of the most graceful" of the Tamil legends connected to the "Temple of the Thousand Columns" atop Swami Rock. An oracle had declared that over the dominions of one of the kings of the Deccan impended a great peril which could only be averted by the sacrifice of his infant daughter, who was committed to the sea on an ark of sandalwood, eventually reaching the island, south of Trincomalee at a place that in the mid 19th century was still called ’’Pālanakai’’ (smiling infant), current Panagai. After being adopted by the king of the district, she succeeded over his dominions. Meanwhile, the Hindu prince Kullakottan, having ascertained from the Puranas that the rock of Trincomalee was the holy fragment "Koneiswara parwatia" of the golden mountain of Meru, hurled there during a conflict between gods, arrived at Swami Rock and constructed a temple of Shiva. The princess, hearing of his arrival, initially dispatched an army to expel him, but ended up marrying the prince to end the war, and later attached vast rice fields of Thampalakamam and built the great Kantalai tank to endow the temple and irrigate the surrounding plain. Upon her death, the prince shut himself inside the pagoda of Swami rock, and was later found translated into a golden lotus on the Shiva altar.