Edgar Welch, 28, of Salisbury, was accused of firing at least three shots from an AR-15 rifle inside the Comet Ping Pong pizzeria in December and pointing the gun at an employee after showing up to investigate the online conspiracy rumors. No one was hurt.

Welch pleaded guilty in U.S. District Court to a federal charge of interstate transportation of a firearm with intent to commit an offense and a local charge of assault with a dangerous weapon.

Welch, dressed in an orange prison jumpsuit, said little more than “Yes, ma‘am” in response to questions from Judge Ketanji Brown Jackson. Asked what he wanted to do, he said, “Plead guilty.”

He could face up to two years in prison on the federal charge and a maximum five years for the assault charge. Jackson scheduled sentencing for June 22.

Welch also faces potential fines and must pay restitution for damage to a computer, door lock and a ping pong table at the restaurant.

A local firearms charge was dropped as part of Welch’s plea. He also carried a loaded .38-caliber revolver into the pizzeria, and police found a loaded shotgun in his car, according to court documents.

Welch told police he was investigating a bogus conspiracy theory known as “pizzagate.” Posts to social media sites such as Twitter, Facebook and the Reddit online message board falsely claimed Comet was the center of a child sex ring run by Clinton and her campaign chairman, John Podesta.

The claims were part of a proliferation of false news reports during the U.S. presidential election campaign, often disseminated through websites purporting to be news outlets and quoting bogus sources.

Scott Talan, a communications professor at Washington’s American University, said Welch was an example of how mistrust of traditional news sources and of authorities’ ability to investigate suspected crimes could prompt vigilante-style behavior.

“For more and more people, the source (of news) doesn’t matter,” he said in a telephone interview.