CHARLESTON, S.C. (Reuters) - The white former South Carolina police officer who was filmed as he shot a fleeing, unarmed black man in the back two years ago could face life in prison after pleading guilty on Tuesday to a federal civil rights violation in the fatal encounter.

Ex-North Charleston patrolman Michael Slager’s admission that he used excessive force against 50-year-old Walter Scott in April 2015 resolves a case that drew national attention amid concerns about police treatment of blacks in cities across the United States.

Slager fired eight shots at Scott’s back, hitting him five times, after the motorist fled a traffic stop for a broken brake light. A bystander’s cellphone video of the shooting was widely circulated.

Convictions of U.S. police officers charged in on-duty fatal shootings are rare. U.S. Attorney General Jeff Sessions said the Justice Department would hold officers accountable for civil rights abuses.

“Such failures of duty not only harm the individual victims of these crimes; they harm our country, by eroding trust in law enforcement and undermining the good work of the vast majority of honorable and honest police officers,” Sessions said in a statement.

Slager, who was dismissed from the police force, told jurors during a state trial that he felt “total fear” before shooting Scott, who he said refused orders to stop running and then grabbed the patrolman’s stun gun during a scuffle.

Saying they were pleased that Slager admitted wrongdoing, Scott’s family called for a stiff punishment when he is sentenced at a later date. The civil rights charge carries a maximum sentence of life in prison.

Slideshow ( 8 images )

“Today is a good day for justice,” Judy Scott, the motorist’s mother, told reporters after the hearing in Charleston.

As part of the agreement, state prosecutors will dismiss a pending murder charge against the former officer. Slager’s trial on the murder charge ended with a hung jury last autumn, and prosecutors had planned to retry him in August.

His trial on three federal charges had been set for this month.

Two of the charges, using a gun while committing the civil rights offense and lying to state investigators after the shooting, were dropped on Tuesday.

The 35-year-old Slager, dressed in a gray suit, was handcuffed after pleading guilty and taken into custody as his wife and parents watched.

The ex-officer’s lawyers did not say why he had decided to stop fighting the charges.

“We hope that Michael’s acceptance of responsibility will help the Scott family as they continue to grieve their loss,” Slager’s law firm said in an email.