With the two princes and his students, Vishwamitra left his Siddhashram and set out for Mithila. When they approached the Ganga River, Vishwamitra began narrating a story about the river, one that concerned the kings of the Solar Dynasty. Ganga was the eldest daughter of Himavan, and her younger sister, Uma, was Lord Shiva's wife. Sagar, a king of the Solar Dynasty, had two wives: Keshini and Sumati. Keshini had an intellectually disabled son named Asamanjasa, while Sumati had sixty thousand sons. Everyone loved Asamanjasa’s son, Amshuman.
Once, when King Sagara was planning an Ashvamedha Yagya, Indra rode away with the yagya's horse. Sagara sent his sixty thousand sons to search for and retrieve the horse. In their eagerness to find it, they caused a commotion that disturbed Maharshi Kapila’s meditation. Angered, Kapil cursed Sagara and Sumati’s sixty thousand sons to be burned to ashes. Garuda, the king of birds and Sumati’s brother, found the horse, returned it to Amshuman, and advised him to complete the yagya. After that, Amshuman was to bring Ganga to earth and free his ancestors from the curse.