Long ago there lived two powerful demons named Mani and Malla. They had acquired power through penance, and had become very proud. Mani and Malla were brothers, and both had gathered a large army of demons. They subjugated other kings and became emperors of the devil's kingdom, tyrannizing the people and harassing the demigods and holy men. They even threatened Lord Indra, the king of the demigods in heaven. They troubled the rishis and munis whenever they were performing their sacrifices, and these had to be discontinued, threatening religion.
The rishis appealed to Vishnu for help, but Vishnu knew that this was Shankar's job, so Vishnu took the rishis along to Shankar's Kailas mountain. Vishnu asked Shankar, "Mahadeva, you must be knowing Mani and Malla, the two brother demons who after performing austerities had come to get your blessing. Now they can only be destroyed by you." "Yes, it's true," said Shankar, "but why such a hurry." "Lord," Vishnu went on, "They have made life miserable."
Shankar is compassionate by nature, so he had pity on the rishis. He reassured the rishis, "Do not worry. I shall destroy the demons and re-establish religion." Shankar dashed his matted hair, and from it a female demon was created. Her name was Ghritamari (Ghrita = butter, ghee). Shankar entrusted her with the job of destroying Mani and Malla, and she was of great help to Shankar in the fight. Ganpati was a leading general of the army.
Sharikar took the form of Bhairav and Parvati became Shakti, and was named Mhalsa. The divine splendour dwelt in the heart of Bhairav. The moon became his horse of bright white. Shankar held in his hands the trisul (trident), the "damaru" (drum shaped like an hour-glass), and a huge "khanda" (two edged sword).
On pratipada day of the bright half of Margashirsh, Mani came to fight with a huge army of demons. The battle went on for six days uninterruptedly. At the end Mani was wounded and fell unconscious. When he recovered consciousness he felt sorry and began to praise Bhairav who was standing before him. He prayed, "Save me!" Bhairav told him to ask for a boon, Mani said, "Now let your foot remain on my head, and let me remain for ever near you." Shankar generously granted this request and Mani died. Then all the Demons lost courage and fled.
The demigods tried to win the friendship of Mani's brother, Malla, but Malla did not listen. Instead he stood ready to fight a second war. At the end Malla too was defeated and like his brother he too begged Shankar for liberation, and Shankar granted him liberation. After the death of Malla, his five sons also attacked Bhairav. Their names were Kumbh, Suchil, Devgandharva, Lohargala, and Mahabahu. The day when the war ended was the sixth day of the bright half of Margashirsh, which became later known as Champashashti.
Shankar gave Mani the privilege of remaining always standing in his presence, and Malla got "moksha" from his hand. Shankar for ever joined Malla's name with his own. Thus joining "Malla" and "an" (enemy) became "Mallani" (The enemy of Malla), which later became "Malhari" (the vanquisher of Malla).