Agni told Vashishtha the story of the fish incarnation.
Many years ago, the whole world was destroyed. The destruction in fact extended to all the three lokas (worlds) of bhuloka, bhuvarloka and svarloka. Bhuloka is the earth, svarloka or svarga is heaven and bhuvarloka is a region between the earth and heaven. All there worlds were flooded with water.
Vaivasvata Manu was the son of the sun-god. He had spent ten thousand years in prayers and tapasya (meditation) in the hermitage Badrika. This hermitage was on the banks of the river Kritamala.
Once Manu came to the river to perform his ablutions. He immersed his hands in the water to get some water for his ablutions. When he raised them, he found that there was a small fish swimming in the water in the cup of his hands.
Manu was about to throw the fish back into the water when the fish said, “Don’t throw me back. I am scared of alligators and crocodiles and big fishes. Save me.”
Manu found an earthen pot in which he could keep the fish. But soon the fish became too big for the pot and Manu had to find a larger vessel in which the fish might be kept. But the fish became too big for this vessel as well and Manu had to transfer the fish to a take. But the fish grew and grew and became too large for the lake. So Manu transferred the fish to the ocean. In the ocean, the fish grew until it became gigantic.
By now, Manu’s wonder knew no bounds. He said, “Who are you? You must be the Lord Vishnu, I bow down before you. Tell me, why are you tantalizing me in the form of a fish?”
The fish replied, “I have to punish the evil and protect the good. Seven days from now, the ocean will flood the entire world and all beings will be destroyed. But since you have saved me, I will save you. When the world is flooded, a boat will arrive here. Take the saptarishis (seven sages) with that boat. Don’t forget to take the seeds of food grains with you. I will arrive and you will then fasten the boat to my horn with a huge snake.”
Saying this, the fish disappeared.
Everything happened as the fish had promised it would. The ocean became turbulent and Manu climbed into the boat. He tied the boat to the huge horn that the fish had. He prayed to the fish and the fish related the Matsya Purana to him. Eventually, when the water receded, the boat was anchored to the topmost peak of the Himalayas. And living beings were created once again.
A danava (demon) named Hayagriva had stolen the sacred texts of the Vedas and the knowledge of the brahman. In his form of a fish, Vishnu also killed Hayagriva and recovered the Vedas.