At the beginning of this creation, Kasiyapa-prajapati and Danu had two powerful sons who competed with the devas (gods), Rambha and Karambha. They practiced austerities (tapas) in order to defeat the gods, but in spite of this Karambha was killed by Indra. Rambha chose to use Brahma’s boon for his ascetic practice to gain a son who would not be defeated by devas or asuras. The boon was granted, and the son was born to his wife, a mahishi (she- buffalo) of great charm. Some versions stated that Rambha lost his caste because of this marriage. They moved to Patala (the netherworld) before the son was born. A giant buffalo (mahisha) tried to steal Rambha’s wife, and, in attempting to prevent the theft, Rambha was killed. Mahishi joined her husband on his funeral pyre (sati). The young buffalo demon grew and eventually became the king of the asuras. Nobody could defeat Mahisha, as the son was called—because of his father’s boon and an extension in the myth of karma from father to son.
Mahisha was intoxicated with pride and even forced the gods to worship him. Finally, they were led by Indra to ask a solution from Brahma, Vishnu, and Siva. They decided upon war. A terrible battle occurred, but Mahisha just could not be killed. The gods had to rest. Then, after several centuries had passed, they gathered together and realized that Mahisha could not be killed by a male—and that would include the Trimurti (Brahma, Vishnu, and (Siva). Mahisha could only be defeated by a woman. Most accounts credited the gods with combining all their powers to create a single being of light, a devi (goddess) of celestial beauty with eighteen arms named Durga. She rode her lion to the entrance way into heaven (Devaloka) and proclaimed that she would become the wife of anyone who could defeat her in armed combat. Mahisha fell in love and was determined to have her. He sent his seconds, then his army, and lastly himself. Finally, he changed into his ferocious form of the buffalo demon but Durga cut off his head with a discus (Vishnu cakra). Thus Mahishasura was killed by Durga, and peace and order were restored to the three realms.
In one major variant of the story, Kali sprang from Durga’s forehead, personifying her anger, so that it would be Kali who killed Mahisha. And when the world again was threatened by evil, by the demons Sumbha and Nisumbha, Durga’s avenging energy, Kali, destroyed them.