In one of the stories, Ayyappan is portrayed as a child of a priest whose father was murdered by the fearsome outlaw Udayanan. The outlaw also kidnaps a princess. Ayyappan then makes a daring rescue, attacks and kills evil Udayanan. In another version of this story, the rulers of Pantalam themselves sent Ayyappan as a mercenary to the Pantya rulers to whom the ruler of Pantalam was related. In another late medieval era variation of the story, Ayyappan forms an alliance with the Muslim warrior Vavar against Udayanan, the basis for some devotees worshiping both in a mosque and then in the Hindu temple before starting a pilgrimage to Ayyappan shrine.