In another incident during the war, Rama and Lakshmana are captured by the rakshasa Mahiravana (or Ahiravan), brother of Ravana, who held them captive in their palace in Patala (or Patalpuri) --the netherworld. Mahiravana keeps them as offerings to his deity. Searching for them, Hanuman reaches Patala, the gates of which are guarded by a young creature called Makardhwaja (known also as Makar-Dhwaja or Magar Dhwaja), who is part reptile and part Vanara.

The story of Makardhwaja's birth is said to be that when Hanuman extinguished his burning tail in the ocean, a drop of his sweat fell into the waters, eventually becoming Makardhwaja, who perceives Hanuman as his father. When Hanuman introduces himself to Makardhwaja, the latter asks his blessings, but fights him to fulfill the task of guarding the gate. Hanuman defeats and imprisons him to gain entry.

Upon entering Patala, Hanuman discovers that to kill Mahiravana, he must simultaneously extinguish five lamps burning in different directions. Hanuman assumes the Panchamukha or five-faced form of Sri Varaha facing north, Sri Narasimha facing south, Sri Garuda facing west, Sri Hayagriva facing the sky and his own facing the east, and blows out the lamps. Hanuman then rescues Rama and Lakshmana. Afterwards, Rama asks Hanuman to crown Makardhwaja king of Patala. Hanuman then instructs Makardhwaja to rule Patala with justice and wisdom.

To date Chandraloak Devpuri mandir is located at Dugana a small village 17 km from Laharpur,Sitapur district,Uttar Pradesh. A divine place where Chakleswar Mahadev situated.