There was a king named Satyarath who ruled over Vidarbha. Once he was attacked by a neighbouring king. Satyarath was killed in that battle. His wife somehow managed to save her life by hiding in a forest. The queen was pregnant at that time.
At the shore of a pond she gave birth to a child. She was feeling thirsty, so she went into the pond to quench her thirst. Unfortunately she was killed by a crocodile who used to live in that pond.
The hungry child started crying. A beggar woman arrived there with her one year old child. Though her heart was filled with compassion seeing the hungry child cry but still she was hesitating to take him in her lap.
Right then lord Shiva appeared as a beggar and advised her to bring up the orphan child. The beggar woman asked about the origin of the child. Lord Shiva told her that the father of this child Satyarath in his previous life had left the pradoshavrata incomplete. He had also ordered his men to severe the head of his enemy. After this, he had broken his fast in his impure state, without taking a bath.
As a result, Satyarath met a premature-death in his next life. The mother of this orphan child too committed a sin by deceitfully getting the co-wife of her husband killed. As a result she was devoured by a crocodile in her next life.
Describing about the child lord Shiva said-
"This child was brahmin by birth in his previous life, but still he never engaged himself in any religious or virtuous deeds. So in his next life, though he was born in a royal family, still he remained poor. You must take this child under your control and after his sacred-thread ceremony gets accomplished, you must engage him in my (Shiva's) devotion. If you don't obey my command then it would not be good for the welfare of your own child."
After saying like this lord Shiva disappeared. The beggar woman took that child to her house and brought him up with great love and care. When he grew up his sacred-thread ceremony was performed and then he was initiated into the worship of lord Shiva.
By the blessing of lord Shiva, Satyarath's son formed a pot full of gold while he was taking both in a pond. Now the beggar family became very rich. Once again when he had gone to a forest he met a 'gandharva' princess to whom he ultimately got married. This way he became a king. He lived happily with his mother and his brother.