QUANTICO, Va. - A fatal shooting in January at the Marine Barracks on Capitol Hill occurred because a Marine lance corporal failed to properly unload his pistol after a guard shift, then pointed the weapon at a fellow Marine and pulled the trigger as a joke, unaware that a bullet was in the firing chamber, a prosecutor said Thursday.

Lance Cpl. Andrew Johnson, charged with unpremeditated murder and several offenses related to his alleged careless handling of firearms, appeared at a preliminary hearing in a courtroom on the Marine base here. A military judge has not yet ruled on whether the evidence against him is sufficient to warrant prosecution.

The victim of the New Year's Day shooting, Lance Cpl. Riley Kuznia, 20, from Karlstad, Minnesota, was "my friend, my brother," Johnson said in a brief statement to the judge. "I live every day with what happened, and I'll live with it every day for the rest of my life."

Pending the outcome of the case, Johnson, from Plymouth, Massachusetts, has been assigned to unarmed administrative duty at the Marine Barracks Washington, a Marine spokesman said. Johnson, who entered the military in July 2017, appears to be in his early 20s. The spokesman said he was not authorized to disclose Johnson's age.

Addressing the court, the prosecutor, Marine Capt. Brendan McKenna, described "an escalation of misconduct" by Johnson last fall and winter in which he allegedly brandished his Marine-issued Beretta pistol recklessly on two occasions before the unintentional fatal shooting.

After a duty shift, guards at the Marine Barracks are required to unload their sidearms in the presence of a supervisor to ensure that the guns are rendered safe, McKenna said. First, he said, the 15-round clip is removed from the pistol. Then the slide is pulled back, ejecting the bullet from the firing chamber, leaving the weapon empty.

Shortly before 5 a.m. on Jan. 1, after finishing a tour of guard duty, Johnson unloaded his Beretta alone rather than wait for a supervisor to watch him, McKenna said.

He said investigators later concluded that Johnson fatally reversed the unloading steps: First he pulled back the pistol's slide, ejecting the bullet from the chamber - but apparently he did not remember that when the slide sprung forward, it pushed a fresh round into the chamber. Then he removed the clip and thought the weapon was empty, McKenna said.

Moments later, Johnson pointed the gun at Kuznia and, laughing, called out his friend's nickname, "Kuz," and squeezed the trigger, McKenna said, describing what witnesses told investigators. After the gun went off and Kuznia collapsed, wounded in the head, Johnson immediately became "distraught" and "dropped the pistol," McKenna said.

No witnesses testified Thursday. McKenna and the lead defense lawyer, Marine Maj. Joshua Ockert, submitted documentary evidence, including investigative reports, and made oral arguments. They are scheduled to file additional written arguments next week. After that, the judge, Marine Maj. John Johnson, will decide whether the defendant should face a court-martial and, if so, on what charges.

Ockert argued that the charge of unpremeditated murder is not justified because there is "no evidence beyond mere speculation that Lance Corporal Johnson intended to pull the trigger" when he pointed the pistol at Kuznia. When Johnson was questioned by District of Columbia police after the shooting, he told detectives that the gun "just went off," according to McKenna.

The degree of Johnson's culpability "is that he pointed a weapon that he thought was unloaded at his friend," Ockert said.

If the judge determines that the evidence is not sufficient to warrant a charge of unpremeditated murder, Johnson could be prosecuted for the lesser offenses of involuntary manslaughter or negligent homicide. The judge also must decide whether Johnson should be court-martialed on four additional charges of dereliction of duty.

One of the four charges relates to the shooting and one involves his alleged repeated use of a cellphone for personal reasons while he was on guard duty last fall and winter. The other two charges stem from his alleged unsafe brandishing of a pistol last fall and on New Year's Eve. McKenna said investigators found cellphone video of the latter two incidents.

According to the charging sheet in his case, on Nov. 25, Johnson "failed to follow firearm handling procedures . . . by removing his pistol from the holster while dancing." On Dec. 31, the eve of the fatal shooting, he allegedly unholstered his weapon and chambered a round, "stating, 'Oh, you're going to a party' . . . or words to that effect."

The Marine Barracks Washington, at Eighth and I streets SE, was founded in 1801 by President Thomas Jefferson and is home to the Marine Drum and Bugle Corps and the Marine Band. Its personnel perform ceremonial and security missions in the nation's capital.

Like Kuznia, Johnson was assigned to the barracks' guard company and underwent extensive training in law enforcement and firearms safety, McKenna said.

This article was written by Paul Duggan, a reporter for The Washington Post.