The location is mentioned as
Thiruaavinankudi in the
Sangam literature Tirumurukāṟṟuppaṭai. As per
Purananuru, the region was known as Vaikavurnadu and was part of
Vaiyapuri Nadu, ruled by king
Kōpperum Pēkan. The place is mentioned by poets such as
Kabilar,
Vanparanar, Aricilkiḻār, and Perunkunrurkiḻār. Sangam literature
Akananuru mentions the name of the place as
Pothini, ruled by
Velir chieftain Vel chieftain Neduvel Avi. The name Pothini was derived from
Tamil language phrase "Pon-udai-nedu-nagar" meaning the big town with
gold, which later became Palani. As per
Patiṟṟuppattu, chieftain Velavikkopaduman had matrimonial relations with the
Cheras, who ruled the region from the late first century CE. Poet
Ilangiranar mentions the Chera king
Mantaram Cheral Irumporai, who ruled the region during the period. The main idol of Murugan in the
garbagriha is believed to have been created and consecrated by sage
Bogar, one of the
Siddhars. The statue is believed to have been made of an
amalgam of nine rocks or herbs known as
navapashanam. According to temple legend, the sculptor had to work rapidly to complete its features. A shrine to Bhogar exists in the southwestern corridor of the temple, which, by temple legend, is said to be connected by a tunnel to a cave in the heart of the hill, where Bhogar continues to meditate and maintain his vigil. The idol fell into neglect and the area was engulfed by the forest. One night, a king of the
Chera Dynasty, who controlled the region between the second and fifth centuries CE, took refuge at the foot of the hills. As per temple legend, Murugan appeared in his dream, and ordered him to find and restore the idol to its former state. The king commenced a search for the idol, and finding it, constructed a temple on the hillock and re-instituted its worship. There are figures of a king, believed to be the Chera king, on the southern walls of the temple and a small
stela at the foot of the staircase that winds up the hill, describing the events. In the
middle age, the area came under the control of
Cholas in the 10th century CE. The Cholas expanded the temple and inscriptions mention various grants made by the Chola kings. Later, the region was ruled over by the
Pandyas, who further expanded the temple complex. Inscriptions found on the temple walls mention grants by Pandya kings such as
Jatavarman Sundara Pandyan I and
Jatavarman Vira Pandyan II during the 13th century CE. In the year 1300 CE,
Maravarman Kulasekara Pandyan I is documented to have gifted a village as a grant to the temple. The
Vijayanagar Empire patronized the temple and the region between the 14th and 16th centuries. After the collapse of Vijayanagara, the
Madurai Nayaks ruled the region.
Arunagirinathar was a 15th-century Tamil poet born in
Tiruvannamalai, who later became a devotee of Murugan and visited Palani. He composed various Tamil hymns glorifying Murugan at the temple, the most notable being part of
Thirupugazh. He became a staunch devotee and composed . Palani temple is one of the
Six Abodes of Murugan and considered one of the most prominent abodes of Muruga. Under the Nayaks,
Palayakkarar system was formulated with the temple being administered by the Palayakkarars of
Balasamudram. The region and the temple was under the influence of
Mysore kingdom in the 18th century before being part of the
Madras Presidency of
British Raj towards the end of the century. After
Indian Independence in 1947, the temple became part of
Madras State which later became
Tamil Nadu. == Layout and architecture ==