WASHINGTON -- A heavy metal guitarist on Friday became the first defendant to plead guilty to federal charges in connection with the insurrection at the U.S. Capitol.

Jon Ryan Schaffer, the frontman of the band Iced Earth, has agreed to co-operate with investigators in hopes of getting a lighter sentence, and the Justice Department will consider putting Schaffer in the federal witness security program, U.S. District Judge Amit Mehta said.

This signals that federal prosecutors see him as a valuable co-operator as they continue to investigate the militia groups and other extremists involved in the insurrection on Jan. 6 as Congress was meeting to certify President Joe Biden's electoral win.

Schaffer, a supporter of former President Donald Trump, was accused of storming the Capitol and spraying police officers with bear spray. He pleaded guilty in a deal with prosecutors in federal court in Washington to two counts: obstruction of an official proceeding, and entering and remaining in a restricted building with a dangerous or deadly weapon.

An email seeking comment was sent to an attorney for Schaffer.

Schaffer is among more than 370 people facing federal charges in the deadly insurrection, which sent lawmakers into hiding and delayed the certification of Biden's win. The Justice Department has indicated it is in separate plea negotiations with other defendants.

Authorities say Schaffer was caught on camera holding bear spray and engaging in verbal altercations with officers in the Capitol. Schaffer was wearing a baseball hat that read "Oath Keepers Lifetime Member" on Jan. 6, but was not charged in the large case involving members and associates of the far-right Oath Keepers militia group, who are accused of conspiring with one another to block the certification of the vote.

Schaffer has voiced various conspiracy theories, once telling a German news station that a shadowy criminal enterprise is trying to run the world under a communist agenda and that he and others are prepared to fight, with violence.

In court documents, the FBI said Schaffer "has long held far-right extremist views" and that he had previously "referred to the federal government as a `criminal enterprise."'

He turned himself in to the FBI a few weeks after the riot, after his photograph was featured on an FBI poster seeking the public's help in identifying rioters.