CHARLESTON, S.C. — More than two years after a North Charleston, S.C., police officer fired eight rounds toward the back of a fleeing and unarmed black motorist, the lawman whose burst of gunfire was recorded on video stood in a federal courtroom Tuesday to plead guilty to charges that he violated the slain man’s civil rights.

The plea by the officer, Michael T. Slager, assured a rare conviction of a law enforcement official for an on-duty killing, and it left him facing the possibility of life in prison for the April 2015 shooting of Walter L. Scott. Mr. Slager pleaded guilty to a single charge of willfully using excessive force to deprive Mr. Scott of his civil rights.

“We asked for justice,” Anthony Scott, one of Mr. Scott’s brothers, said. “We received justice.”

Mr. Slager said little during a brief hearing in United States District Court here, but he acknowledged the factual basis for the plea agreement, which said he had “used deadly force even though it was objectively unreasonable under the circumstances.”