Mandavya was an ancient sage, was once wrongly punished by the king believing him to be a thief, since, some robbers were hidden their stolen articles near his hermitage when he was in deep meditation, and he was wrongly assumed to have stolen the goods. He checked with Lord Yama about his karmic deeds. Yama told that he had given the punishment since he had tortured small insects in his childhood.
Mandavya cursed Lord Yama Dharma, since acts done by him in his child hood would not attract such a severe punishment, and said that he will be born in the mortal world. Due to that, Lord Dharma was born as Vidura, the wise minister and the half- brother of the blind King Druthrashtra. He lived in a dharmic path throughout his life, and also given various teachings to the Kauravas in order to correct them.