The temple legend in the Kandha Purānam - the Tamil version of the Skanda Purāna which is mainly devoted to Murugan (also known as Skandha or Kandha) - states that Murugan had imprisoned the creator-god Brahmā here for the latter's ignorance of Om, the single syllable mantra which is sacred in Hinduism and himself assumed the role of the creator in this place. However, Murugan's father Shiva had ordered him to release Brahmā. When Murugan realized his mistake in not obeying his father's instruction, he did penance before a Linga (the aniconic symbol of Shiva), which subsequently was worshipped by the name of Devasenāpathīsar, literally, the Lord who was worshipped by Devasenāpathi (an epithet of Murugan as the commander-in-chief of the gods). In another version it is said that the penitent Brahmā is said to have been released by Shiva after he worshipped Murugan after learning his lessons in humility.