CHARLESTON, S.C. (Reuters) - The white former policeman caught on video shooting an unarmed black man in the back after a 2015 traffic stop in South Carolina was sentenced on Thursday to 20 years in prison, with a federal judge ruling that the killing amounted to murder.

The decision came a year after Michael Slager’s state murder trial for the death of 50-year-old Walter Scott ended with a deadlocked jury. Slager, 36, is one of the few police officers in recent years in the United States to receive prison time for an on-duty shooting.

“Everyone recognizes that this was a tragedy,” U.S. District Judge David Norton told a Charleston courtroom packed with members of both men’s families.

“What’s just for the Scott family is not necessarily just for the Slager family, and what’s just for the Slager family is not necessarily just for the Scott family,” he said. “It’s a zero-sum game.”

Slager was a patrolman in North Charleston when he pulled over Scott, a father of four, for a broken brake light on April 4, 2015. He said he opened fire because he felt threatened after the motorist tried to take his stun gun during a struggle.

Yet he pleaded guilty in May to violating Scott’s civil rights by using excessive force, a charge that carried a possible lifetime prison sentence. Slager shot at Scott eight times, hitting him five times.

State prosecutors dropped the murder charge in exchange for the federal plea.

Slideshow ( 5 images )

On Thursday, Slager expressed remorse.

“I wish this never would have happened,” said Slager, jailed since his plea and dressed in an inmate’s gray and white jumpsuit. “I wish I could go back and change events, but I can’t and I am very sorry for that.”

A bystander’s cellphone video of the shooting drew national attention to the case, renewing concerns about police treatment of minorities.

The footage was a centerpiece of the four-day sentence hearing, with both prosecutors and defense lawyers arguing it bolstered their cases.

Norton sided with the government, finding that Slager had committed second-degree murder and obstructed justice by lying to investigators about Scott trying to grab his Taser.

The judge rejected the defense argument that Slager was provoked or acted in the heat of passion.

Scott’s relatives and their lawyers said the punishment marked a historic moment for justice. They called on law enforcement to rethink the use of deadly force.

Before court ended, several family members told Slager they had forgiven him. But their pain has not diminished.

“We will never be the same again,” said Anthony Scott, the motorist’s older brother. “How could someone shoot someone in the back like that as they were running away?”