Sagara was a great king of Ayodhya, and he was performing the Ashwamedha Yagya in order to become the emperor of the total known world. And while he was performing this Yagya, Indra came and stole the horse. And he stole the horse, and he ran from the scene with the horse and he fled to the ashram of Kapil Muni.
Kapil Muni was meditating. Indra tied the horse to the gate of the ashram and left. Sagara’s sixty thousand sons ran in pursuit of the horse. They came to Kapil Muni’s ashram and they said, “Hey Muni, wake up from your meditation, why did you steal our father’s horse?” Kapil Muni woke up from his meditation and said, “What horse? I don’t know what you’re talking about?”
And the kids said, “Hey, what do you mean, now not only are you a thief, but you are a liar too. Here’s the horse tied right to the gate of your ashram.” Kapil Muni got mad, he said, “I am neither a thief, nor a liar, and you guys come in here disturbing the peace of my ashram, you go away from here before I curse you.”
The boys said, “Hey, now not only are you a liar and a thief but now you are a belligerent old man, and you are not worthy of being called the Rishi.” And they said, “You are deserving of punishment, we are going to throw stones at you.” They threw a stone at him and they hit him in the head.
And Kapil Muni took some Ganga water in his hand and he said, “I pronounce the curse on you”.
And he turned the sixty thousand sons of Sagara to ashes.
Sagara was beset with anxiety and despair. He went and he fell at the feet of Kapil Muni and he prayed for his sons to be brought back to life. And Kapil Muni said, “Look, those kids deserved what they got, they were belligerent, they called me names, they accused me of stealing and lying and being a belligerent old man. And when any member of your family brings Ganga to the earth, she will wash those ashes to the ocean and your sons will be returned to you.”
So Sagara began to pray to Ganga, and he wasn’t successful in making Ganga come to the earth. So he went and became the Ocean.
Then came a whole lineage of kings that were born in the lineage of the descendants of Sagara. And they all tried, and they were unsuccessful until Bhagirath came and did a tremendous tapasya. And he decided, I’m not going to call Ganga to come, Ganga lives in the kamandalu of Brahma, I’m going to call Brahma.
So then he prayed to Brahma. And Brahma said, “Yes, I can certainly make Ganga come to the earth, but she will come with such force that she will wash away the earth. You have to call Shiva and ask him to accept Ganga on his head to break the force of her fall to earth so that she doesn’t wash away the earth and then she’ll trickle down the locks of Shiva’s hair. And she’ll become a river, and that river will wash the ashes into the Ocean.”
Bhagirath prayed to Shiva, and Shiva gave him the boon. And Ganga came to the earth like water from the kamundalu of Brahma washing the feet of Vishnu. Falling on to the hair of Shiva and coming down and washing the earth, purifying all of the sins of humanity.
So Sagar was the Ocean and he was a predecessor in the lineage of Ram.