Panchamukha Hanuman or Lord Panchamukha Anjaneyaswamy is the Lord Hanuman who appears with five faces. The origin and the legend of Panchamukha Hanuman are given here in this article. The origin of Sri Panchamukha Anjaneya can be traced to a story in the Ramayana. During the Ramayana war (the war between Lord Rama and Ravana), Ravana sought the help of Mahiravana who was the King of Pathala (Netherworld).
In order to protect Lord Sri Ram and Lakshman from Mahiravana, Hanuman formed a fortress with his strong tail. Mahiravana came to know this and took the form of Vibheeshana and took Ram and Lakshman to his Pathal loka.
Hanuman entered into Pathala loka in search of Ram and Lakshmana where he found Mahiravana who was in the form of five lamps. To protect Ram and Lakshmana, Hanuman had to kill the demon. But Hanuman has one face and the demon has his life in 5 lamps. The 5 lamps had to be extinguished at the same time to demolish Mahiravana.
Hanuman thought for a while and took the form of Panchamukha with Hanuman, Hayagriva, Narasimha, Garuda and Varaha faces and extinguished the lamps and thus killed Mahiravana to protect his Lord.

