Bao Zheng ( 包拯 ; Bāo Zhěng ; 5 March 999 – 3 July 1062), commonly known as Bao Gong ( 包公 ; Bāo Gōng ; 'Lord Bao'), was a government officer during the reign of Emperor Renzong in China's Song Dynasty . During his twenty-five years in civil service, Bao consistently demonstrated extreme honesty and uprightness, with actions such as sentencing his own uncle, impeaching an uncle of Emperor Renzong's favourite concubine and punishing powerful families. His appointment from 1057 to 1058 as the prefect of Song's capital Kaifeng , where he initiated a number of changes to better hear the grievances of the people, made him a legendary figure. During his years in office, he gained the honorific title Justice Bao (包青天) due to his ability to help peasants overcome corruption.