Once a king called Sagara, one of the forefathers of Lord Rama ruled the kingdom Kosala. He wished to conduct Ashwamedha Yajna to establish his supremacy over the neighboring regions. As per the custom, the horse was released. Those who would accept the supremacy of the king would let the horse go unstopped while those who wish to challenge the same would capture the horse. Then the king who performed the sacrifice would battle with the challenger and take back the horse. While no one dared to stop the horse, the horse was lost after sometime.
King Sagara sent his sixty thousand sons in search of the horse who scanned the regions on the move in looking for the horse. Even they burnt down forests to search for the royal insignia. Finally when they reached the hermitage of Sage Kapila, they found the horse tied there. In fact, it was Indra who captured the horse for the sake of putting an end to the Yajna and tied it in the hermitage of Kapila for escaping the blame. However, the sons of Sagara neither knew this nor made any efforts to learn. Instead, they accused the sage of stealing the horse and wished to attack him. The angry sage casted a powerful look at them and the 60,000 sons of Sagara were burnt to ashes in his hermitage.
Sagara was taken to despair. However, he was helpless as none could pacify the angry sage to do something about it. However, Sagara was only worried that the souls of all his sons was lying there without redemption. Generations passed without any solution to the plight. One of the descendants of Sagara named Anshuman was told that the only way to redeem their souls was to bring Ganges to the earth and let it flow on their ashes.
During those days, the Ganges was only flowing in the heavens. It was not a human task to bring Ganges on to the earth. However, one of the descendants named Bagirata did penance for a thousand years to propitiate the Ganges. Ganges appeared in front of him and asked what was to be done. When Bagirata requested the Ganges to flow on the earth, she said her flow on the earth would be so powerful to break the earth into pieces. Therefore she could do something only if someone can control her torrential flow from the heavens when descended.
Bagirata then did a penance towards Lord Shiva. Lord Shiva accepted to do something to mollify the force of the Ganges. When the Ganges descended on the earth, Shiva spread out his matted hair and received the Ganges on it finally allowing the Ganges to flow softly on the earth. Therefore, Lord Shiva came to be called as Gangadhar who mercifully accepted to receive Ganges on his matted hair.
Bagiratha led the Ganges to the hermitage of Kapila Maharishi and the souls of the ancestors were redeemed and directed to the heavens with the power of the Ganges waters.