In the Ikshvaku dynasty there ruled a king named Harishchandra. Harishchandra had no son. One day two sages named Narada and Parvata came to visit Harishchandra and told him that he would go to hell if he did not have a son.
“How can I obtain a son?” asked Harishchandra.
Harishchandra pleased Varuna with his prayers and asked for a son.
“You will have a son,” said Varuna. “But there is a condition attached. You will have to subsequently organise a yajna in my honor and you will have to sacrifice your son at this yajna. Tell me if this condition is acceptable to you.”
“Yes indeed,” replied Harishchandra.
In due course, Harishchandra had a son who was named Rohita.
Varuna came to Harishchandra and asked, “What about the yajna in my honor?”
“My son is still too young,” replied Harishchandra. “Let him at least attain ten days of age. Till then, the baby is in any case impure and is not fit to be sacrificed.”
After ten days Varuna came again and asked, “What about the yajna in my honor?
“Please let him grow his teeth,” replied Harishchandra. “Animals are sacrificed at yajnas. And no one becomes an animal until he actually has teeth.”
Varuna waited till the teeth grew and returned when Rohita was seven years of age. “What about the yajna in my honor?” he asked.
“These are only milk teeth,” replied Harishchandra. “These do not characterise an animal. Please wait until his proper teeth have grown.”
Varuna returned when the proper teeth grew and asked, “What about the yajna in my honor?”
“He is the son of kshatriya (the second of the four classes, a warrior class),” replied Harishchandra. “But his training in the art of fighting has not even begun. He cannot be called a kshatriya until he knows how to fight. Till that day he is an incomplete man. Do you really want such an incomplete man as a sacrifice?”
After some years had passed, Rohita became skilled in the art of fighting and was appointed the heir-apparent (yuvaraja) to the kingdom. He was then sixteen years of age.
Varuna appeared again and asked, “What about the yajna in my honor?”
This time the entire conversation took place in front of the prince and Rohita intervened before Harishchandra could say anything. “Father,” he said, “I have already resolved to perform a yajna in Vishnu’s honor. Grant me the permission to complete that first. After that, do what you will.”
Rohita went off to the forest. Meanwhile, Varuna had had enough and he afflicted Harishchandra with a painful stomach ailment. News of his father’s illness was taken to Rohita in the forest. In the forest, Rohita met a sage named Ajigarta. The sage was very poor and, together with his wife and three sons, was starving.
“Will you sell one of your three sons to me?” asked Rohita. “The boy is needed for a sacrifice.”
“I shall not sell my eldest son,” said the sage. “My wife will not permit the youngest one to be sold. You can have the one in the middle. His name is Shunahshepa. The price will be one thousand cows, one thousand golden coins, one thousand pieces of clothing and a lot of wealth.”
Rohita paid the price and brought Shunahshepa home to Harishchandra.
“We can’t do this,” said Harishchandra. “It is the duty of kings to protect the brahmanas. How can we sacrifice the son of a brahmana? It is better to die instead. Go and return Shunahshepa to his father.”
Just then a divine voice was heard from heaven. The voice said, “There is no need for anyone to die. Take Shunahshepa to the banks of the Goutami Ganga and perform the yajna to Varuna there. Goutami Ganga is such a sacred river that no human sacrifices are needed if a yajna is performed there.
This is what Harishchandra did not Varuna was satisfied. As for Shunahshepa, he was adopted by the sage Vishvamitra as a son.