Srimad Bhagavatam Canto 03, Chapter 05, Text 20

SB 3.5.20

mandavya-sapad bhagavan
 praja-samyamano yamah
bhratuh ksetre bhujisyayam
 jatah satyavati-sutat
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
I know that you are now Vidura due to the cursing of Mandavya Muni and that formerly you were King Yamaraja, the great controller of living entities after their death. You were begotten by the son of Satyavati, Vyasadeva, in the kept wife of his brother.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
Mandavya Muni was a great sage (cf. Bhag. 1.13.1), and Vidura was formerly the controller Yamaraja, who takes charge of the living entities after death. Birth, maintenance and death are three conditional states of the living entities who are within the material world. As the appointed controller after death, Yamaraja once tried Mandavya Muni for his childhood profligacy and ordered him to be pierced with a lance. Mandavya, being angry at Yamaraja for awarding him undue punishment, cursed him to become a sudra (member of the less intelligent laborer class). Thus Yamaraja took birth in the womb of the kept wife of Vicitravirya from the semen of Vicitravirya’s brother, Vyasadeva. Vyasadeva is the son of Satyavati by the great sage Parasara, and Vicitravirya is the son of the same Satyavati by the great king Santanu, the father of Bhismadeva. This mysterious history of Vidura was known to Maitreya Muni because he happened to be a contemporary friend of Vyasadeva’s. In spite of Vidura’s birth from the womb of a kept wife, because he had otherwise high parentage and great connection he inherited the highest talent of becoming a great devotee of the Lord. To take birth in such a great family is understood to be an advantage for attaining devotional life. Vidura was given this chance due to his previous greatness.
Srimad Bhagavatam Canto 03, Chapter 05, Text 19
Srimad Bhagavatam Canto 03, Chapter 05, Text 21