CHARLESTON, S.C. — A white police officer whose killing of a black motorist running from a traffic stop was recorded on a cellphone video pleaded guilty Tuesday to violating his civil rights, a conviction that could send him to prison for decades.


As part of the plea deal, South Carolina prosecutors are expected to drop the state’s murder case against Michael Slager, who was fired from the North Charleston police force when the bystander’s video became public.


Slager, 35, could have been imprisoned for life in each case if convicted in the April 2015 death of Walter Scott. He had been scheduled to appear in federal court Tuesday for motions ahead of his federal trial planned for later this month.


The video of Scott’s death, viewed millions of times online, begins after Slager caught up with the 50-year-old motorist who ran from a traffic stop. Scott can be seen breaking away after they struggled over the officer’s Taser. Slager began firing at Scott’s back from 17 feet away. Five of the eight bullets hit him.


Walter Scott is seen running from his vehicle in a photo released by South Carolina’s State Law Enforcement Division.


The video of Scott’s death, viewed millions of times online, begins after Slager caught up with the 50-year-old motorist who ran from a traffic stop. Scott can be seen breaking away after they struggled over the officer’s Taser. Slager began firing at Scott’s back from 17 feet away. Five of the eight bullets hit him.


Other killings of black men by white officers had raised alarm, but the grainy video captured Scott’s death clearly enough for many more people outside African-American communities to accept the complaints fueling the Black Lives Matter movement.


In March, a judge ruled that jurors in Slager’s federal trial would be allowed to view the video, over objections by his defense attorneys.


The plea deal in the civil rights case, accepted by a judge Tuesday, makes no mention of race.


“The defendant willfully used deadly force even though it was objectively unreasonable under the circumstances,” according to the plea agreement. “The defendant acknowledges that during the time he used deadly force, he knew that the use of deadly force was unnecessary and excessive, and therefore unreasonable under the circumstances.”