The temple is believed to have been built by the Early Chola king Kocengannan.
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.
The region is believed to have been covered with Madhu forest and hence called Madhuvanam.
There are shrines to Ganesha, Murugan, Bhairava, Surya and the Navagrahas.
This article about Hindu place of worship in Tamil Nadu is a stub.