At that time, a ferocious demoness, with the face of a she-buffalo, Mahishi by name, propitiated Brahma who bestowed upon her enough brutal might and longevity of lite so that she usurped the throne of Devendra and was perpetrating atrocities in Devaloka. The tormented gods sought the help of Mahavishnu. A buffalo was created and was bidden to entice Mahishi and descend with her on to the earth. The newly created Mahisha was called Sundara Mahisha. He came to the land of gods and appeared before Mahishi. The sight of male partner evoked her sensual desire. Forgetful of herself she started enjoying worldly pleasures in the company of her consort.
Devendra got back his lost throne and the gods were relieved of their fear for the monster. But they could not rest contented. They were apprehensive of her return to Devaloka and resumption of her tormenting mischief. So they prayed to Siva for the annihilation of the demoness. Brahma while giving boon to her hadn't blessed her with physical immortality. It was made known to her that she would be killed by the is born to Siva and Vishnu. Mahishi who presumed the impossibility of two males begetting a child, was least afraid of the end of her life. The main purpose of Ayyappa's birth was the killing of Mahishi.
As such, the Lord did not want to delay the fulfillment of his life's mission. He encountered the monsters on the bank of the river Azhutha. The trepidous demoness ferociously hit back at the Lord. A terrible fight followed. At last he caught hold of Mahishi by her horns and whirling around threw her down on the ground. The Lord danced gleefully on her fallen body. The gods were delighted and sang songs praising the Lord. Dharma triumphed over evil. Even the Trinity came down to earth to witness the great event. The place where Mahadeva tethered his vehicle, the ox, is now known as' Kalaketti '.
Mahishi's death was verily a blessing in disguise to her. She was, in fact, a celestial damsel cursed to be born with the face of a she-buffalo. Now that she was redeemed from her curse, she assumed her original beautiful form and paid obeisance to Ayyappa. Further, she expressed her desire to the Lord to accept her as his consort. But Ayyappa, an avowed bachelor, refused to oblige. But this did not diminish his esteem for her. She was assigned the status of the Mother goddess. It is Mahishi who is worshipped as ‘Malikappurath Amm' (the mother-goddess on the tower) in the shrine to the left of the Ayyappa temple.
Brahma, who was present on the occasion of the fight between Ayyappa and Mahishi, wanted the physical remains of the demoness to be covered by a heap of stones, lest it should grow to such immense height, that the path of the sun and the moon would be impeded.