A white former South Carolina police officer committed second-degree murder when he shot an unarmed black motorist to death and should expect to spend about two decades in prison, a judge said as he prepared to sentence him for a federal civil rights violation.

Michael Slager should expect to serve 19 to 24 years in prison for the shooting of Walter Scott in April 2015, US District Judge David Norton warned about the sentencing guidelines he would use.

Before he announced the punishment, he had to decide whether it was manslaughter or murder.

A formal sentence will be delivered after the judge hears testimony from Scott's family and friends. His mother, Judy Scott, said through tears that her faith in God gives her the ability to forgive Slager. Scott's brother Anthony Scott echoed that sentiment.

"I'm not angry at you, Michael. Michael, I forgive you, and Michael, I do pray for you now and for your family, because we've gone through a traumatic time," he said.

Attorneys for the ex-North Charleston Officer said he shot 50-year-old Walter Scott in self-defence after the two fought and Scott reached for Slager's stun gun.

They said race didn't play any role in the shooting and that Slager never had any "racial animus" toward minorities.

Still, Slager pleaded guilty in federal court to violating Scott's civil rights.

Black Lives Matter organises march to Trump Tower Show all 15 1 /15 Black Lives Matter organises march to Trump Tower Black Lives Matter organises march to Trump Tower Kandy Freeman participates in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower Hawk Newsome, a Black Lives Matter activist, leads a protest outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Hawk Newsome (C) leads a chant during a Black Lives Matter protest in front of Trump Tower in New York City, US. January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower An NYPD officer speaks with a Black Lives Matter leaders during a protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Kandy Freeman participates in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower An NYPD officer speaks with a Black Lives Matter leaders during a protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Carol Garza, a Black Lives Matter supporter, protests outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower People participate in a Black Lives Matter protest in front of Trump Tower in New York City, U.S. January 14, 2017. Stephanie Keith/Reuters Black Lives Matter organises march to Trump Tower A Black Lives Matter supporter protests in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Black Lives Matter activists march in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty Black Lives Matter organises march to Trump Tower Black Lives Matter activists march in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty Black Lives Matter organises march to Trump Tower Black Lives Matter supporters protest in the snow outside Trump Tower in New York City on January 14, 2017. Dominick Reuter/AFP/Getty Images Black Lives Matter organises march to Trump Tower Black Lives Matter Kandy Freeman marches in front of Trump Tower on January 14, 2017 in New York City. Kevin Hagen/Getty

As part of the plea agreement reached in May, prosecutors dropped state murder charges. A year ago, a state judge declared a mistrial when jurors deadlocked.

A bystander captured the shooting on a mobile phone and it was shared around the world, setting off Black Lives Matter protests across the US as demonstrators said it was the perfect example of police officers' mistreatment of African-Americans.

The bystander started recording after the struggle between Slager and Scott. The video showed Scott running away from Slager and the officer firing eight times. Scott was hit in the back five times.

After the shooting, Slager picked up his stun gun and placed it next to Scott. Slager contends he was securing the weapon. Prosecutors think he put it there to bolster his self-defence story.

The judge also found that Slager, 36, obstructed justice when he made statements to state police after the shooting.

Clutching a photograph of his father Scott's youngest son, Miles Scott, told the court he has had trouble sleeping ever since his father's death.

He said he missed watching football games with his dad and can't fathom not being able to watch with him the game they both loved.

"I miss my father every day," he said through tears. "I would like you to sentence the defendant to the strongest sentence the laws allows because he murdered my one and only father."

Federal officials recommended 10 to nearly 13 years in prison. His attorneys argue Slager should face far less time.