The legend behind this cave is as follows: Even though the ghosts got the darshan of the Lord, they did not get salvation. Lord Parasurama again got sad. He went to Brihaspati, the guru of devas, for a remedy. Brihaspati told that as the ghosts achieved many births due to their karma (action), they will not get salvation. So, Lord Parasurama called Vishwakarma, the divine architect. He came with Indra and Brihaspati. As the place for ghosts should not be near the temple, they found a suitable place some point away from the temple. There, Vishwakarma detected the presence of Trimurtis (Brahma, Vishnu & Shiva), and Brihaspati began to conduct poojas. At that time, Lord Parasurama constructed a tank named 'Ganapathi Theertham' on the starting. Within the time the construction was completed, he built two more tanks, namely 'Papanasini' and 'Pathala Theertham'. Indra constructed 'Ambutheertham' with his arrows and Airavata, his vehicle, constructed 'Kombutheertham' with his tusks. The ghosts entered through the cave and got salvation.