 The temple is believed to have been built by the Early Chola king Kocengannan.It is one of the shrines of the 275 Paadal Petra Sthalams.Nanillam is one of the many temple towns in the state which is named after the grooves, clusters or forests dominated by a particular variety of a tree or shrub and the same variety of tree or shrub sheltering the presiding deity.