These twin qualities were tested heavily in his life by various circumstances that led him to penury and separation from his family. But he stood to his principles in the face of all ordeals and persevered to become a symbol of courage.
It is said that the great sage Vishwamitra, once approached Harishchandra and informed him of a promise made by the king during the sage's dream to donate his entire kingdom. (Accounts differ on how the sage had got the promise from the king. Some other legends say, it was by way of pacification when the king had once disturbed the sage's penance to his consternation.) Harishchandra was so virtuous, that he immediately made good his word and donated his entire kingdom to the sage and walked away with his wife and son.
Since, the entire world was under the sage after he donated his kingdom, the king had to go to Varanasi, a holy town dedicated to Lord Shiva. This was now the only place outside the influence of the sage. But, the sage, proclaimed that for an act of donation to be completed, an additional amount as Dakshina (honorarium) had to be paid. Harishchandra, with no money in his hands, had to sell his wife and son to a Brahmin Grihastha to pay for the Dakshina. When the money collected still did not suffice for the purpose, he sold himself to a guard at the cremation ground, who was in charge of collecting taxes for the bodies to be cremated.
The king, his wife and son had to sustain tremendous hardships doing their respective chores. The king helped the guard cremate the dead bodies, while his wife and son were used as household helpers at the house of the Brahmin. Once, the son had been to the garden to pluck flowers for his master's prayer, when he was bitten by a snake and he died instantly. His mother, having nobody to sympathise for her, carried his body to the cremation grounds. In acute penury, she could not even pay the taxes needed to cremate him. Harishchandra hearing her wails, came to her and recognised her as his wife and was stung by pangs of agony.
But, Harishchandra, was dutybound by his job to perform the cremation only after the acceptance of the tax. So, he asked his wife, if she was willing to undergo further hardships and stand by him in this hour of calamity. The faithful wife readily gave assent. She had in her possession only a saree, a part of which was used to cover the dead body of her son. She offers half of her lone dress as the tax, which Harishchandra could accept and perform the last rites of his son. When she proceeded to remove her dress, miracles happened.
Lord Vishnu, Indra and all Devas and the sage Vishwamitra himself manifested themselves on the scene, and praised Harishchandra for his perseverance and steadfastness. They brought his son back to life. They also offered the king and his wife, instant places in heaven. The virtuous king, refused saying that he cannot leave behind his subjects, by Kshatriya Dharma. He asked for a place in heaven for all his subjects. But the gods refused, explaining that the subjects had their own Karma and they have to undergo them. The king was then ready to forego all his virtues and religiousness for his people, so that they could ascend to heaven leaving him behind. The gods, now immensely pleased with the unassailable character of the great king, offered heavenly abode to the king, the queen and all their subjects.
The sage Vishwamitra helped to populate the kingdom again and installed Harishchandra's son as the king.
This moving story affected one of the greatest men of the 19th-20th century,Mahatma Gandhi who was deeply influenced by the virtues of telling the truth when he watched the play of Harischandra in his childhood.The Legend of Harishchandra's ideal life