A North Carolina man was arrested Sunday after he walked into a popular pizza restaurant in Northwest Washington carrying an assault rifle and fired one or more shots, D.C. police said. The man told police he had come to the restaurant to “self-investigate” a false election-related conspiracy theory involving Hillary Clinton that spread online during her presidential campaign.

The incident caused panic, with several businesses going into lockdown as police swarmed the neighborhood after receiving the call shortly before 3 p.m.

Police said 28-year-old Edgar Maddison Welch, of Salisbury, N.C., walked in the front door of Comet Ping Pong and pointed a firearm in the direction of a restaurant employee. The employee was able to flee and notify police. Police said Welch proceeded to discharge the rifle inside the restaurant; they think that all other occupants had fled when Welch began shooting.

Welch has been charged with assault with a dangerous weapon. Police said there were no reported injuries.

Interim D.C. Police Chief Peter Newsham said police arrived on the scene minutes after the first call, set up a perimeter and safely arrested Welch about 45 minutes after he entered the restaurant.

A D.C. police report made public Monday says Welch had been armed with an AR-15 assault-style rifle. The report also says police seized a Colt .38 caliber handgun and a shotgun. One of those weapons was found inside the restaurant; the other in the suspect’s car. Police did not specify the locations.

The police report also describes Welch’s arrest. Police said he surrendered shortly after officers surrounded the pizza shop and emerged with his hands raised above his head.

The report says in addition to the weapons, police seized a folding knife, a T-shirt, a hooded sweatshirt and denim blue jeans.

Vivek Jain, of Potomac, Md., was eating lunch inside Banana Leaf, a nearby Indian restaurant, when Comet patrons came rushing inside. He said Banana Leaf was locked down for about 90 minutes.

“A bunch of people ran in from Comet and said a man walked in with a gun,” Jain said.

About 45 minutes later, he said, he saw a man walking backward out into the street with his hands in the air.

“He laid down on Connecticut Avenue and he was immediately picked up by the police and taken away,” he said.

The popular family restaurant, near Connecticut and Nebraska avenues NW in the Chevy Chase neighborhood, was swept up in the onslaught of fake news and conspiracy theories that were prevalent during the presidential campaign. The restaurant, its owner, staff and nearby businesses have been attacked on social media and received death threats.

Although police initially said it did not appear the incident was related to the threats, businesses and residents immediately surmised it might be connected to “pizzagate.”

James Alefantis, the owner of Comet Ping Pong, said in a statement: “What happened today demonstrates that promoting false and reckless conspiracy theories comes with consequences. I hope that those involved in fanning these flames will take a moment to contemplate what happened here today, and stop promoting these falsehoods right away.”

The restaurant’s owner and employees were threatened on social media in the days before the election after fake news stories circulated claiming that then-Democratic presidential nominee Hillary Clinton and her campaign chief were running a child sex ring from the restaurant’s backrooms. Even Michael Flynn, a retired general whom President-elect Donald Trump has tapped to advise him on national security, shared stories about another anti-Clinton conspiracy theory involving pedophilia. None of them were true. But the fake stories and threats persisted, some even aimed at children of Comet Ping Pong employees and patrons. The restaurant’s owner was forced to contact the FBI, local police, Facebook and other social-media platforms in an effort to remove the articles.

Last month, citing its policy against posting the personal information of others, Reddit banned the “pizzagate” topic.

But it didn’t stop the harassment, and nearby businesses have received threats as well, according to police. On Sunday, Washington Post reporters involved in this article were the target of online threats shortly after it posted.

Matt Carr, the owner of the Little Red Fox market and coffee shop, said his business started getting threats last weekend. They got 30 to 40 calls before they stopped answering calls from blocked numbers, he said. “One person said he wanted to line us up in front of a firing squad,” said Carr, who spent more than an hour in lockdown with his employees Sunday.

The threats were all tied to the Comet Ping Pong accusations online, he said. “There’s some old painted-over symbol on the marquee that they claim is an international symbol of pedophilia and that there are underground tunnels. . . . There’s some video on YouTube that has almost 100,000 views and talks about me, the owner of the Little Red Fox, by name.

“This was our worst fear,” he said, “that someone would read all this and come to the block with a gun. And today it happened.”

Politics and Prose, the bookstore that has been a Washington institution and neighborhood fixture for more than 30 years, was in the middle of a book event when attendees and staff saw police converging on the block, said Bradley Graham, a store co-owner.

They, too, had received threats recently, Graham said, and were planning to meet with police Monday “because we had feared that what, up to now, had been simply despicable menacing verbal attacks online or on the phone might escalate.”

Graham said he was told that the gunman walked into the kitchen at Comet Ping Pong on Sunday, “presumably looking for the alleged tunnels” where children were hidden and tortured. Graham believes that account of the gunman’s actions came from an employee at the restaurant.

He said the businesses are hoping to get more police protection, “and we would also hope that law enforcement authorities will be prompted to take additional measures to shut down the sites where this hateful material is being spread, and also measures to try to trace the menacing phone calls.

“ . . . We’re all rather shaken,” he said.

“Political figures have the means to deal with conspiratorial allegations and threats, but your neighborhood mom and pop shop does not,” Carr said later in an email. “I make coffee and breakfast burritos for a living. This is out of our league.”

D.C. Council member Mary M. Cheh (D-Ward 3) was getting gas down the street from Comet Ping Pong and saw what she described as intense police activity around the restaurant. Cheh said she spoke with Mayor Muriel E. Bowser (D), who had been briefed by police. At the time she spoke to reporters, Cheh didn’t know the gunman’s actions were connected to the false rumors surrounding Comet Ping Pong, but she was concerned.

“It’s very, very worrisome,” Cheh said. “I’m just very worried that [the rumors] may have unleashed people who are unstable to pursue violent action, as has happened before.”

She praised the speed of the police response, which she said may have prevented an attack. “It all looked so efficient and professional. I was very pleased it was locked down so quickly.”

Gareth Wade, 47, and Doug Clarke, 50, were sitting down for pizza and beer at Comet when they spotted a commotion. All of a sudden, said Wade, “the server said someone just walked in with a shotgun.

“A man had just walked into the building, passed us into the back of the building, he seemed to have a shotgun or a rifle-type of [gun] and said we ought to vacate the building,” Wade recalled the server saying.

They rushed out of the restaurant and had planned to head to Politics and Prose, where Clarke’s wife and 5-year-old took shelter, but they got separated. Clarke and Wade were met by a heavy police presence when they attempted to join up.

“Police said you can’t go to the bookstore,” Wade said. They ended up behind the police barricade at Connecticut Avenue and Fessenden Street. Clarke’s wife and son were forced to remain inside the bookstore. Meanwhile, Clarke was trying to reunite his son with a present he had received for his fifth birthday, a stuffed lion that they were forced to leave inside the restaurant.

“He’s kind of shaken up about the whole thing,” Clarke said. “We’ve been talking a lot about it and trying to help him understand. That he was a man with a weapon, weapons are bad — he was not a nice person.”