THE ANECDOTE OF KAALI & HANUMAN
The relation between Hanuman and Goddess Kali finds mention in the Krittivasi Ramayana. Their meeting takes place in the Yuddha Kanda of Ramayana in the legend of Mahiravana.
Mahiravana was a trusted friend/brother of Ravana. After his son, Meghanatha was killed, Ravana sought Mahiravana, the King of Patalaloka’s help to kill Rama and Lakshmana.
One night, Mahiravana, using his Maya, took Vibhishana’s form and entered Rama’s camp. There he cast the Nidra mantra on the Vanar Sena, kidnapped Rama and Lakshmana and took them to Patala Loka. He was an adherent devotee of Mahamaya/Kali/Durga and Ravana convinced him into sacrificing the valiant fighters of Ayodhya to the goddess to which, Mahiravana agreed.
Hanuman, upon understanding the way to Patala from Vibhishana headed for rescuing his lords. Down, he met Makardhwaja who claimed of being Hanuman’s son, being born from his sweat/seed which was consumed by a Makara (crocodile). Hanuman defeated and tied him and went inside the palace. There he met Chandrasena who told about the sacrifice and the way to kill Ahiravana.
Hanuman then shrank his size to that of a bee and went towards the huge idol of Maha-Kali. He asked her to let him save Rama, and the fierce mother goddess agreed as Hanuman took her place while she slipped below. When Mahiravana asked the prince-sages to bow, they refused as they were of royal lineage and didn’t know how to bow.
So as Mahiravana was about to show them how to bow, Hanuman took his Pancha-Mukha form (with the head of Garuda, Narasimha, Varaha, Hayagreeva and himself: each head signifying a particular trait. Hanuman courage and strength, Narasimha fearlessness, Garuda magical skills and the power to cure snake bites, Varaha health and exorcism and Hayagriva victory over enemies), blew the 5 oil lamps in 5 directions and severed the head of Mahiravana by thus killing him.
He later took Shri Rama and Lakshmana on his shoulders and as he flew outside Shri Rama saw Makardhwaja tied with his tail. He right away ordered Hanuman to crown him the King of Patala.
The story of Ahiravan finds its place in the Ramayanas of the East. It can be found in the Bengali version of the Ramayana, written by Krittibash. The passage which talks about this incident is known as ‘Mahirabonerpala’.
It is also believed that after being pleased with Hanuman, Goddess Kali blessed him to be her dwara-paal or gate-keeper and hence one finds Bhairava and Hanuman on either side of the temple entrance of the Goddess’ shrine.