A judge upheld a 20-year prison sentence for a white former police officer in the killing of an unarmed Black man in South Carolina on Monday, saying the officer's lawyer did not do a poor job.

Michael Slager had appealed his sentence, saying his lawyer never told him about a plea offer from prosecutors that could have cut years off his eventual prison term for fatally shooting Walter Scott.

But federal Judge Richard Gergel wrote in his ruling Monday that he believed Slager's lawyer Andy Savage, who said in court papers as Savage pleaded guilty in 2017 that he told his client about every plea offer. Slager testified during a hearing last week he didn't know about the initial deal from prosecutors.

FILE- In this Dec. 5, 2016 file photo, Michael Slager, at right, walks from the Charleston County Courthouse under the protection from the Charleston County Sheriff's Department after a mistrial was declared for his trial in Charleston, S.C. Slager, a former South Carolina police officer serving 20 years in prison for killing an unarmed Black man who was running away from a traffic stop, said his lawyer never told him about a plea offer from prosecutors that could have cut years off his sentence. He is requesting a new sentence in federal court this week. (AP PhotoMic Smith, File)

FILE- In this Dec. 5, 2016 file photo, Michael Slager, at right, walks from the Charleston County Courthouse under the protection from the Charleston County Sheriff's Department after a mistrial was declared for his trial in Charleston, S.C. Slager, a former South Carolina police officer serving 20 years in prison for killing an unarmed Black man who was running away from a traffic stop, said his lawyer never told him about a plea offer from prosecutors that could have cut years off his sentence. He is requesting a new sentence in federal court this week. (AP PhotoMic Smith, File)

Slager’s 20-year sentence was one of the longest in recent memory for a police officer for an on-duty killing.

Slager pleaded guilty to a federal civil rights charge for shooting Scott in the back five times on April 4, 2015. Slager had pulled over the 50-year-old Black motorist for a broken brake light when their confrontation was captured on a bystander’s cellphone video that later spread worldwide on social media.

In the encounter, the two could be seen tumbling to the ground after Slager hit Scott with a Taser. Authorities said their investigation found Scott got back up and was shot from a distance of about 15 feet (5 meters) as he ran from the officer.

The shooting itself was captured on video, something Slager didn’t know when he initially told investigators that Scott had charged at him after stealing his Taser.

“At sentencing, Petitioner attempted to blame the victim. Now, he attempts to blame his defense counsel and the trial judge. But a careful review of this entire tragic episode makes plain that Petitioner has no one to blame for his present predicament and sentence but himself,” Gergel wrote.

Savage is one of South Carolina’s most accomplished attorneys and at the time he was also representing a Black church member whose life was spared in a racist massacre that killed nine people in a Charleston church in 2015, two months after Slager’s arrest.

Follow Jeffrey Collins on Twitter at https://twitter.com/JSCollinsAP.