We have seen how Ambika cleverly made her maid to receive Veda Vyasa in her place and how Vidura was born to her. It is said that it was Dharmaraja, the Chief Justice of the world above, who took birth as Vidura because of a curse on him.
There was a sage named Mandavya who spent all his time meditating in a standing posture with raised hands in supplication to the Almighty. One day some thieves came his way carrying their booty and the soldiers of a nearby king in hot pursuit. The thieves found the hermitage of the sage a convenient place to conceal what they stole and they hid themselves nearby.
When the soldiers saw Mandavya in standing posture they asked him about the thieves. The sage was under the vow of silence while meditating. Getting no reply from the silent monk the soldiers went on their search on their own. They could easily find the booty behind the very hermitage and became suspicious. Further search revealed the hiding thieves. They thought that the sage was an accomplice and informed the king accordingly. On his command they pierced spears into the body of all including the sage and brought them to the king.
When other sages came to know what happened to Mandavya they were grief stricken and they all thronged to the palace. Mandavya, though mounted on a spear, remained meditating. The king was surprised to find that the sage was still alive and he heard about his powers from the other sages. He realized his mistake and apologized to sage Mandavya. The soldiers were promptly ordered to bring the sage down from the top of the spear. But, they could not pull the spear out from the belly of the sage. Finally, they had to cut the parts of spear projecting out. It is said that Mandavya remained alive for several more years carrying the point of spear within his belly. He, thus, came to be known as Ani-Mandavya, or Mandavya with a spear in him.
The sage was taken to Dharmaraja, the chief justice of heaven, after death as is the custom. Then the sage asked Dharmaraja what he must have done in his earlier births to deserve such a severe punishment. The Dharmaraja plodded through his books and found the appropriate entry. The sage used to play by piercing sticks into the belly of ants when he was a small child. This judgement, too harsh for an innocent child’s ignorant play, made the sage furious. The sage pointed out angrily that the Dharmaraja made a serious error in his judgement as only humans do. Accordingly, he cursed the God of justice to take birth as a human being .
That is how Dharmaraja took birth as Vidura by the curse of Ani-Mandavya.