The shooting on Jan. 24, 2019, drew national attention because Mr. Hendren was on duty at the time. Ms. Gardner had also accused the Police Department of obstructing the investigation in its rush to initially label the shooting an accident.

Image Nathaniel Hendren Credit... St. Louis Police Department, via Associated Press

Mr. Hendren had been on duty when he met Officer Alix, who was off duty, at his apartment where the two began “dry-firing” their handguns, according to the plea agreement.

Mr. Hendren had produced his revolver, emptied the cylinder and put one round back in, the statement said, adding: “Mr. Hendren pointed the revolver down the hallway and pulled the trigger. The gun did not discharge.”

Officer Alix then took the gun from Mr. Hendren, pointed it at him and pulled the trigger. It did not fire.

Mr. Hendren retrieved the gun, pointed it at her and pulled the trigger. It fired and Officer Alix was fatally shot in the chest, the authorities said.