From his deathbed, the king of Mithila had told his ministers that to find a man worthy of being king, they must look for one who could answer certain riddles, who could string the king's powerful bow, and who could please his daughter, the beautiful and intelligent Princess Sivali. There were many candidates for the throne. Each one, in an effort to win Sivali, obeyed her every whim. The more they tried to please her, the more she scorned them and sent them away. Moreover, not one had the wit to answer the riddles or the strength to string the royal bow.
At last the ministers decided to send out the festive chariot to see if they could find a successor to Polajanaka. They decorated the city, yoked four noble steeds to the handsome carriage, and bade the musicians follow behind as is proper when a royal chariot is empty. Then they ordered the carriage to lead them to the one who had sufficient merit to be king of Mithila. Followed by a great crowd, it took them through the city to the eastern gate and onward to the park where Mahajanaka lay sleeping. After circling the stone, the chariot came to a stop. The ministers observed the sleeping prince and examined his feet, whereby they recognized the signs of royalty. Indeed, they saw that he was not only a future king but also destined to be emperor of four continents. They commanded the musicians to sound their instruments. At the noise, Mahajanaka awoke. Seeing all the people around him, he recognized that the white umbrella of kingship had come to him. He asked where the king might be. When told that he had died, he agreed to accept the kingdom.
Meanwhile, Princess Sivali was waiting. However, when the new king arrived he did not visit her or pay her any attention. One day when he was strolling in the garden, she could bear his indifference no longer. Running up to offer him her arm to lean on, she showed that he pleased her. Shortly thereafter she became his queen.
King Mahajanaka answered the riddles with ease. He was also able through his great strength to string the bow of King Polajanaka, so that he fulfilled all the conditions for becoming king. Wisely and well he ruled for seven thousand years. His wife Sivali bore him a son and heir to the throne.
One day the king was riding through his kingdom with his ministers when he observed two mango trees. The one that had been full of mangoes was broken and torn by the people who had come to pick the fruit, while the other, though barren, stood green and whole. Thus he came to understand that possessions bring only sorrow, and he determined to put aside his kingdom and take up the life of an ascetic. After shaving his head and putting on the robes of a hermit, he departed from the palace. But Queen Sivali, who loved him, followed him with great retinue. Wherever he went, she was behind him. At last he could bear it no longer. He cut a stalk of grass and said to her, "As this reed cannot be joined again, so you and I can never be joined again."
At his words, Sivali fell down to earth. While the courtiers were attending to her, Mahajanaka disappeared into the forest. When the queen awoke, she could find him nowhere. He was never again seen in the world of men, for he found his way to the Himavat forest and eventually entered the Brahma heaven.
The despairing queen returned to Mithila and arranged for the coronation of her son. Having settled the affairs of the kingdom, she herself donned the robes of a hermit, and after many years she too was deemed worthy of entrance into the kingdom of the gods.