Sage Mandavya was once performing austerities in with his arms up in front of his ashram. A few thieves who had stolen from the King’s palace, came across the ashram, dumped their loot and ran away seeing the king’s men running behind them.
When the King’s men arrived, they assumed that Mandavya was a part of the theft and captured him. The thieves were also caught and presented to the king along with Mandavya. Mandavya, due to his vow of silence, refused to speak and was put to death penalty by being struck with the tip of a trident.
The thieves died while Mandavya was alive. The king later realising Mandavya’s innocence, rushed to seek forgiveness, and his men tried to pull the trident but were unsuccessful. With no other option, they cut the tip of the Trident, giving him the name Ani Mandavya. He then approached Yama and asked him what sins had he committed to have suffered like this. Yama replied that he had tortured small birds when he was young. Mandavya stated the shastras said, No man should suffer for sins committed before the age of 12.
And since Yama had committed a crime of murdering a Brahmin, he was cursed to be born as a Shudra on Earth. He was reborn as Vidura, the half-brother of Pandu and Dhritarashtra.