In times of yore, Lord Brahma came to the earth to perform a Yaga (fire Sacrifice). He did it in the present Varkala. He was so much immersed in doing Yaga that he forgot his job of creation. Lord Vishnu came to Varkala to remind Lord Brahma about it in the form of a very old man. The Brahmins assisting Lord Brahma, received the old man and gave him food. But whatever he ate, his hunger was not satiated. Lord Brahma’s assistants went and told him about it.
Then Lord Brahma could understand that the guest was Lord Vishnu himself. He immediately came near Lord Vishnu and found him trying to eat Aabhojanam. Lord Brahma then prevented Lord Vishnu from eating it and told him - "Lord, if you eat it, then the final deluge will swallow this world." Lord Vishnu then requested Lord Brahma to stop the Yaga and recommence his job of creation. He also showed him his 'Viswaroopa'.
After this one day Sage Narada followed by Lord Vishnu was walking in the sky over Varkala. Lord Brahma who came there saluted Lord Vishnu. The nine Prajapathis to whom only sage Narada was visible laughed at Lord Brahma.
Because they thought that Lord Brahma was saluting his own son Sage Narada. Then Lord Brahma corrected them. They felt sad at having committed a sinful deed. Lord Brahma told them that the proper place to pray for their redemption would be shown to them by sage Narada. Sage Narada threw the Valkala (deer’s skin) that he was wearing towards the earth. It fell in the present Varkala.
The Prajapathis wanted a pond to do the atonement. Sage Narada requested lord Vishnu, who made a pond there, using his Chakra (wheel). The Prajapathis did thapas there and were pardoned for their sins. It is believed that the 'Devas' constructed a temple of Lord Vishnu there and were worshiping the Lord Janardhana.
But this temple got dilapidated. At that time, several centuries ago, the then Pandya king was affected by a ghost. He went on a pilgrimage but nowhere did he find any cure. When he came to the present day Varkala, he saw the remnants of the dilapidated temple by the sea. He prayed to the Lord saying that he would rebuild the temple there. The next day he had a dream. It told him that the following day he should go to the sea and stand near the dilapidated temple.
Nearby he would see a huge amount of flowers floating in the sea and that if he searched there he would get an idol. He was instructed to make a golden hand and attach it to the idol and build a temple round it. The present Janardhana idol was recovered from the sea by him. He built the temple and laid down the rules for maintenance of the temple. The idol of Janardhana has Aabhojana in its right hand.
People believe that over the years this hand is raising slowly. The day that the idol is able to eat the aabhojana from his right hand, the world will face the great deluge. There are small temples of Lord Shiva, Ganapathi, Sastha and Naga Devatha in this temple. The idol is always dressed in sandals and flowers either in the form of Janardhana, Narasimha, Venugopala or Mohini. Ashtami Rohini, the birthday of Lord Krishna, which comes in the month of Chingam (August–September) is celebrated as a festival here. On the southern side of the temple two bells are tied. There is a story about it as well. One Dutch ship was passing this way and suddenly the ship refused to move in spite of all efforts.
The people told the captain of the ship to tie a bell in the Janardhana temple. It seems the captain and his assistant came ashore and tied the bells. As soon as they tied the bells, the ship started moving. The names inscribed in the bell are 'Peter von Belson' and 'Michelle Evarald'. People believe that if worship of ancestors is done in this temple, then they would be pleased. Possibly because of this the Janardhana is also called Pithru Mokshakan.