In ancient India, a king named Harischandra ruled over Kosala kingdom. This kingdom exemplified the adage: yathaa raajaa tathaa prajaah, which means: as the king, so are the subjects. The people of the kingdom were virtuous: they avoided anything evil; they did not drink nor did they gamble; they were not arrogant of their wealth; they were truthful and just in their dealings. As as result of these virtues, there was no famine, sickness or untimely death in the kingdom. People were healthy and strong; women were beautiful, cultured and all the people looked upon their king as their father and the queen as their mother. In an extraordinary quirk of fate, the very virtues brought trouble to the king and the kingdom.
Vasishta was the family priest of the king. He got into a dispute with sage Visvamitra on the possibility of finding a man of incorruptible virtue. Viswamitra contended that this was impossible; even a virtuous person can fail if put to rigorous tests. Vasishta's argument was that while Viswamitra had a point in general terms, there were indeed exceptional men in the world who cannot be tempted to give up their virtue. He cited Harischandra as one such man. Viswamitra laughed and said that Vasishta seemed to be carried away because Harischandra was the latter's patron. Viswamitra challenged that he will put Harischandra to such a rigorous testing that Vasishta would be proved wrong. Both the sages agreed to conduct the experiment with gods as witnesses.
Viswamitra forthwith proceeded to the capital of Harischandra's kingdom, Ayodhya and learnt that the king was proceeding on a hunting expedition. Viswamitra went ahead of the king and sat down in tapas in a wayside ashram. As the king's hunting party passed by, the sage created an illusion of female voices crying, 'O save us, save us from this man." The king replied, "I am coming to help. I will pierce with my arrows, the wretch molesting women" and ran towards the direction from which the cries were heard. The sage's tapas was disturbed with all the commotion. The king prostrated before the sage and apologized to him for the disturbance caused offering his kingdom and his wealth in reparation.
"What? Are these meaningless words?" Viswamitra questioned angrily.
"O Sage, I speak with all sincerity. I will keep my word."
"I take you at your word, then," responded the sage, "You are already indebted to me; you owe me the fees for the Rajasuya sacrifice which I had asked you to hold in trust for me."
"I will pay the fees whenever you demand, O Viswamitra."
"Okay; get back to your capital and arrange to hand over your kingdom and all your wealth."
Viswamitra held Harischandra to his words and went the next day to gain control of the kingdom and all the palace wealth. Harischandra gave up all that and also the ornaments of his queen.
"O sage, what more should I give you"
"Who is the king of Kosala now," roared Viswamitra.