The legend and mythology of Ayyappan vary across regions, reflecting a tradition that evolved over time. According to the
Puranas, he is mentioned as an incarnation of Hariharaputra, the son of Shiva and Mohini (female form of Vishnu). According to Malayalam folklore, Ayyappan is presented as a warrior prince of
Pandalam kingdom. The king of Pandalam found a baby boy on the banks of
Pamba river. As the royal family was childless, the king named the boy Manikantha and raised him his own son, on the advice of an ascetic. When Manikantha was 12 years old, the king wanted to formally anoint him as the heir. However, the queen objected to it, as she favored her younger biological child. In another version, he is described as the son of the king's sister, who was born in the forest and sent to his uncle later. When the shrine of Sastha at Sabarimala was destroyed by the king's enemies, he defeated them, re-installed the statue and disappeared into it. In some versions, he was raised by a childless royal couple Rajashekara
Pandian and Koperundevi, and grew up as a warrior yogi. According to Paul Younger, supplementary legends appeared in the late
Middle Ages that linked other Hindu deities and mythologies to Ayyappan. The divine beings
Datta and Leela came to Earth as humans. Datta wanted to return to the divine realm, but Leela enjoyed her life on Earth and wanted to stay on Earth. He became angry and cursed her to become a Mahishi (water buffalo demoness). Leela in turn cursed him to become
Mahisha, a water buffalo demon and they both plundered the earth with their evil acts. Mahisha was later killed by goddess
Durga, while Mahishi was killed by Ayyapan, ending the terror of evil and liberating Leela who was previously cursed. These legends syncretically linked and combined various Hindu traditions around
Shaivism,
Vaishnavism and
Shaktism. In the later years, the stories of Ayyappan expanded. One such version has roots between the 1st and 3rd century CE, where he evolved to be a deity who protected traders and merchants from enemies such as robbers and plundering outlaws. His
temples and traditions inspired Hindu yogi mercenaries who protected the trade routes in South India from criminals and helped restore Dharmic trading practices. In another version, he is portrayed as a child of a priest whose father was murdered by a fearsome outlaw. The outlaw kidnapped a princess and he made a daring rescue while killing the outlaw in the process. In a variation of the story, Ayyappan forms an alliance with the
Muslim warrior
Vavar against the outlaw Udayanan, which forms the basis for worshiping both in a Hindu temple and a
mosque before starting a pilgrimage to Ayyappa shrine. According to Eliza Kent, the legends relating to the Ayyappa tradition seem to be "artificially mixed and assembled into a kind of collage". Ruth Vanita suggested that Ayyappan probably emerged from the fusion of a
Dravidian god of tribal provenance and the Puranic story of Shiva and Mohini's interaction. In some regions, Ayyappan and Tamil folk deity
Ayyanar are considered to be the same with similar characteristics and is cited as a reason for his large following amongst
Tamils. == Worship==