The origin of Sri Panchamukha Hanuman can be traced to a story in the Ramayana. During the war between Lord Ram and Ravana, Ravana took the help of Mahiravana who was the king of pathala. Lord Hanuman in order to protect Lord Ram and Lakshman formed a fortress with his tail. But Mahiravana took the form of Vibeeshana and took Lord Ram and Lakshman to pathala loka.