Hindu legends According to Hindus and some Buddhist texts, the main shrine is dedicated to
Kartikeya, known as Murugan in Tamil sources. Kartikeya, also known as Kumara, Skanda, Saravanabhava, Visakha or Mahasena, is the chief of warriors of celestial Gods. The
Kushan Empires and the
Yaudheyas had his likeness minted in coins that they issued in the last centuries BCE. The deity's popularity has waned in North India but has survived in South India. In South India, he became known as Subrahmaniya and was eventually fused with another local god of war known as Murugan among Tamils. Murugan is known independently from
Sangam literature dated from the 2nd century BCE to the 6th century CE. Along the way, a number of legends were woven about the deity's birth, accomplishments, and marriages, including one to a tribal princess known amongst Tamil and Sinhalese sources as
Valli. The
Skanda Purana, written in
Sanskrit in the 7th or 8th century, is the primary corpus of all literature about him. A Tamil rendition of the
Skanda Purana known as the
Kandha Puranam written in the 14th century also expands on legends of Valli meeting Murugan. The
Kandha Puranam plays a greater role for Sri Lankan Tamils than Tamils from India, who hardly know it. In Sri Lanka the Sinhala Buddhists also worshiped Kartikeya as Kumaradevio or Skanda-Kumara since at least the 4th century, if not earlier.
Buddhist legends One of the Sinhala legends tells that when Skanda-Kumara moved to Sri Lanka, he asked for refuge from Tamils. The Tamils refused, and he came to live with the Sinhalese in Kataragama. As a penance for their refusal, the deity forced Tamils to indulge in body piercing and fire walking in his annual festival. This legend tries to explain the location of the shrine as well as the traditional patterns of worship by Tamils. Another Sinhala legends attests that Kataragama deviyo was the deity worshiped by
Dutugamunu in the 1st century BCE, before his war with
Ellalan, and that Dutugamunu had the shrine erected to Skanda-Kumara at Kataragama after his victory. Yet another legend says that Kataragama deviyo is a deification of the legendary king Mahasena, who is born as a
bodhisattva or Buddha in waiting. Anthropologists
Richard Gombrich and
Gananath Obeyesekere were able to identify new strands of these legends and the originators of these legends since the 1970s, with the burgeoning popularity of the shrine and its deity amongst the Sinhala Buddhists. According to the practice of cursing and
sorcery peculiar to Sinhala Buddhists, Kataragama deviyo has his dark side represented by
Getabaru and
Kadavara. Katagama devio is also directly invoked in sorcery practices.
Muslim legends A number of Muslim pious and holy men seems to have migrated from India and settled down in the vicinity. The earliest known one is one Hayathu, whose simple residence became the mosque. Another one called Karima Nabi is supposed to have discovered a source of water that when drunk provides immortality. Historic figures such as Jabbar Ali Sha (died 1872) and Meer Syed Mohhamed Alisha Bawa (died 1945) also have
mausoleums built over their
Tombs.
Vedda legends descent taking a pilgrimage on foot (Pada Yatra) from the town of
Muttur in the east of Sri Lanka to the temple Muslim or Islamic legends about Kataragama are relatively newer. According to Muslims Kataragama is referred to as al-Khidr or land of Khidr. The
Veddas who have kept out of the mainstream culture of Sri Lanka do not subscribe to Kataragama deviyo as their deity. Unassimilated Veddas consider
Kande Yakka or Gale Yakka (Lord of the Rock) as their primarily deity to be propitiated before hunts. They propitiate the deity by building a shrine made out of thatched leaves with a lance or arrow planted in the middle of the structure. They dance around the shrine with the
shaman becoming possessed with the spirits of the dead ancestors who guide the hunting party in techniques and places to go hunt. Anthropologist
Charles Gabriel Seligman felt that the Kataragama deviyo cult has taken on some aspects of the Kande Yakka rituals and traditions. A clan of Veddas who lived near to the shrine was known as
Kovil Vanam (Temple precincts). As a clan they are extinct but were to be found in the eastern province during the 19th century. Local Veddas believed that the nearby mountain peak of Vaedihitti Kande (The Mountain of Veddas) was the abode of the deity. The deity after coming over the shore married a local Vedda woman named Valli, a daughter of a Vedda chief and resided in the mountain. Eventually he was coaxed into settling down at the current location. ==Temple layout==