As per Hindu legend, Brahma, the Hindu god of creation, disrespected Muruga (the son of Shiva) at the time of visiting Mount Kailash, the abode of Shiva. The child Muruga got angry with Brahma and asked him how he was creating living beings. Brahma said that he was creating living beings with the help of the Vedas (Hindu scriptures).
On hearing the reply, Muruga asked Brahma to recite the texts from Vedas. Brahma started to recite the text with the holy word called Pranav Mantra, "Om". At that time Muruga stopped Brahma and asked him to explain the meaning of the Pranava Mantra.
Brahma did not expect such a question from the child and could not reply. Muruga knocked Brahma on his forehead with his clenched fists and punished him with imprisonment. Muruga took up the role of the creator. The Devas (celestial deities) were surprised by the absence of Brahma and they requested Vishnu to negotiate with Muruga to release Brahma. Vishnu could not help and as the last resort, Shiva went to the rescue of Brahma.
Shiva came to Muruga and asked him to release Brahma from imprisonment. Muruga refused to release him stating Brahma was unaware of the meaning of the Om - (Pranav Mantra-Tamil: ௐ AUM).
Shiva asked Muruga to explain the meaning and Muruga extolled to Shiva the meaning of Om. Shiva behaved like a student to a teacher, listening with rapt attention from his son, giving Muruga the name "Swaminatha Swami".
The meaning of this name is "The Teacher of Shiva".Following the legend, the shrine of the son Muruga is atop the hillock, while the father Shiva's shrine is located at the basement.
As per the Kanda Puranam, once all sages and gods assembled in Kailash to witness the wedding of Shiva with Parvathi. It resulted in the tilting of earth towards one direction. Shiva asked sage Agasthya to move towards South to balance the tilt.
Agastya employed a demon by name Ettumba to carry two hills in his shoulders to be placed in the South. The demon carried the hills down south and rested in a place. When he tried to lift one of the hills, it didn't budge and he found a young man standing at the top of the hill not allowing it to be moved.
The demon tried to attack the young man, but was smitten. Sage Agastya identified the young man as Karthikeya and asked him to pardon the demon. Karthikeya readily did so and let the hill remain there at Pazhani. It is a practice followed in the modern times where people carry milk in both their shoulders as a devotion to please Karthikeya. The demon carried the other hill to Swamimalai.
Swamimalai is one of the Arupadaiveedu, believed to be the six main abodes of Muruga, that mark the different phases of his life. According to Hindu belief, Swamimalai is where Muruga preached what as called as "Pranava mantra" to his own father,
Shiva, at a young age, after arresting Brahma for not answering his question about Pranava Mantram. The teaching capabilities of Murugan is found as one of his identifying features. The cult of Murugan is of pride to the Tamil people who identify six with Murugan connating six directions and six chakras in human anatomy.
According to Hindu legend, Mahalingaswamy at Thiruvidaimarudur is the centre of all Shiva temples in the region and the Saptha Vigraha moorthis (seven prime consorts in all Shiva temples) are located at seven cardinal points around the temple, located in various parts of the state.
The seven deities are Nataraja in Chidambaram Nataraja Temple at Chidambaram, Chandikeswarar temple at Tirucheingalur, Vinayagar in Vellai Vinayagar Temple at Thiruvalanchuzhi, Muruga in Swamimalai Murugan Temple at Swamimalai, Bhairava in Sattainathar Temple at Sirkali, Navagraha in Sooriyanar Temple at Suryanar Kovil and Dakshinamoorthy in Apatsahayesvarar Temple, Alangudi at Alangudi, Papanasam taluk.
Arunagirinathar was a 15th-century Tamil poet born in Tiruvannamalai. He spent his early years as a rioter and seducer of women. After ruining his health, he tried to commit suicide by throwing himself from the northern tower of Annamalaiyar Temple, but was saved by the grace of Murugan.
He became a staunch devotee and composed Tamil hymns glorifying Murugan, the most notable being Thirupugazh. Arunagirinathar visited various Murugan temples and on his way back to Tiruvannamalai, visited Swamimalai and sung praises about Swaminathaswamy.