Welch has been charged with assault with a dangerous weapon. Police said there were no reported injuries.
Interim DC 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.
Police recovered two firearms inside the restaurant; an additional weapon was recovered in Welch's car.
Vivek Jain, of Potomac, Maryland, 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 neighbourhood of DC, 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, did not immediately respond to messages seeking comment.
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 paedophilia. 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. Today, 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, which is next door to Comet Ping Pong, 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 paedophilia 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 neighbourhood 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 today, "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 neighbourhood 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."
DC Council member Mary Cheh was getting fuel 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 Bowser, 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 rumours surrounding Comet Ping Pong, but she was concerned.
"It's very, very worrisome," Cheh said. "I'm just very worried that [the rumours] 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 a nearby police barricade. 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."