What was finally real was Edgar Welch, driving from North Carolina to Washington to rescue sexually abused children he believed were hidden in mysterious tunnels beneath a neighborhood pizza joint.

What was real was Welch — a father, former firefighter and sometime movie actor who was drawn to dark mysteries he found on the Internet — terrifying customers and workers with his ­assault-style rifle as he searched Comet Ping Pong, police said. He found no hidden children, no secret chambers, no evidence of a child sex ring run by the failed Democratic candidate for president of the United States, or by her campaign chief, or by the owner of the pizza place.

What was false were the rumors he had read, stories that crisscrossed the globe about a charming little pizza place that features ping-pong tables in its back room.

The story of Pizzagate is about what is fake and what is real. It’s a tale of a scandal that never was, and of a fear that has spread through channels that did not even exist until recently.

Pizzagate — the belief that code words and satanic symbols point to a sordid underground along an ordinary retail strip in the nation’s capital — is possible only because science has produced the most powerful tools ever invented to find and disseminate information.

Comet Ping Pong owner, James Alefantis, addresses reporters during the reopening of his restaurant days after a gunman entered with an assault rifle, firing it at least once. (The Washington Post)

What brought Welch to the District on a crisp Sunday afternoon in early December was a choking mix of rumor, political nastiness, technological change and the intoxicating thrill that can come from running down a mystery.

His actions Sunday in one of Washington’s wealthiest neighborhoods reminded Americans that last month’s election did not quite conclude the strangest political season in the nation’s history. Welch did not shoot anyone in the disturbance on Connecticut Avenue NW, but he delivered a troubling message about the shattering of trust in a troubled time.

On Oct. 28, FBI Director James B. Comey told Congress that he was reopening the investigation of Hillary Clinton’s use of a private email server when she was secretary of state. New emails had been found on a computer belonging to disgraced former New York congressman Anthony Weiner, the estranged husband of top Clinton aide Huma Abedin. Two days later, someone tweeting under the ­handle ­@DavidGoldbergNY cited ­rumors that the new emails “point to a pedophilia ring and ­@HillaryClinton is at the center.” The rumor was retweeted more than 6,000 times.

The notion quickly moved to other social-media platforms, including 4chan and Reddit, mostly through anonymous or pseudonymous posts. On the far-right site Infowars, talk-show host Alex Jones repeatedly suggested that Clinton was involved in a child sex ring and that her campaign chairman, John Podesta, indulged in satanic rituals.

“When I think about all the children Hillary Clinton has personally murdered and chopped up and raped, I have zero fear standing up against her,” Jones said in a YouTube video posted on Nov. 4. “Yeah, you heard me right. Hillary Clinton has personally murdered children. I just can’t hold back the truth anymore.” Jones eventually tied his comments about Clinton to U.S. policy in Syria.

According to YouTube, that video has been viewed more than 427,000 times.

Over the next couple of days, the wild accusations against Clinton gradually merged with a new raft of allegations stemming from WikiLeaks’ release of Podesta’s emails. Those emails showed that Podesta occasionally dined at Comet Ping Pong.

On Nov. 7, the hashtag #pizzagate first appeared on Twitter. Over the next several weeks, it would be tweeted and retweeted hundreds or thousands of times each day.

An oddly disproportionate share of the tweets about Pizzagate appear to have come from, of all places, the Czech Republic, Cyprus and Vietnam, said Jonathan Albright, an assistant professor of media analytics at Elon University in North Carolina. In some cases, the most avid retweeters appeared to be bots, programs designed to amplify certain news and information.

“What bots are doing is really getting this thing trending on Twitter,” Albright said. “These bots are providing the online crowds that are providing legitimacy.”

Online, the more something is retweeted or otherwise shared, the more prominently it appears in social media and on sites that track “trending” news. As the bots joined ordinary Twitter users in pushing out Pizzagate-related rumors, the notion spread like wildfire. Who programmed the bots to focus on that topic remains unknown.

On the Friday before the election, James Alefantis, who owns two restaurants on the same block in upper Northwest Washington, noticed something odd in his Instagram feed: a stream of comments calling him a pedophile.

Upset, Alefantis told some of his young employees at Comet Ping Pong about the hateful comments, and they poked around online. They found rapidly burgeoning discussions on Reddit, 4chan and Instagram about a purported child sex ring operating out of their restaurant.

Alefantis, who grew up in an affluent section of the District, was no stranger to politics. He had held a fundraiser for the Clinton campaign at Comet. He’d had a relationship with David Brock, the erstwhile Clinton nemesis who had a midcareer political conversion and became a pro-Clinton advocate. And Alefantis had lots of customers and friends in liberal Democratic circles.

When Alefantis opened Comet a decade ago, he’d had a run-in with an advisory neighborhood commissioner, a local official who did not like it when Comet put ping-pong tables on the sidewalk. That commissioner had warned that having game tables on the sidewalk might bring “rapes and murders” to the virtually crime-free neighborhood.

Now, a decade later, a Washington Post column about that dispute was trending on Twitter. Somewhere out there, thousands of people were hungrily searching the Internet for anything remotely troubling about Comet Ping Pong.

In the final days before the election, other shopkeepers on the block began to receive threatening phone calls and disturbing emails. Strangers from faraway places demanded to know about symbols on their shop windows or photos on their walls.

Across from Comet, at the French bistro Terasol, co-owner Sabrina Ousmaal noticed a disturbing Google review of her restaurant that alleged that Terasol, too, was involved in a plot to abuse children.

Then, more online comments appeared, focusing on a photo on Terasol’s website that showed Ousmaal and her daughter posing with Clinton, who had eaten there several years earlier. The Internet sleuths also fixated on a heart logo that appeared on the restaurant’s site as part of a fundraiser for St. Jude Children’s Research Hospital, which Ousmaal, a cancer survivor, has supported for years.

“These maniacs thought that was a symbol of child pornography,” said her husband and business partner, Alan Moin. “It’s crazy.”

The family removed the symbol from their site, but the online comments adapted to the new reality: Terasol must be hiding something. The anonymous calls increased.

“What can we do?” Ousmaal said. “There is no basement. There is no tunnel. There is nothing.”

Alefantis and other merchants were mystified: Where was this all coming from? Can’t anyone make it stop?

The merchants approached Facebook and Twitter and asked that disparaging, fictitious comments about them be removed. The shopkeepers said the replies they got advised them to block individual users who were harassing them.

The owner of 4chan, Hiroyuki Nishimura, said in an email to The Post that “Pizzagate reminds me that a country indicated [there were] stockpiles of weapons of mass destruction in Iraq and many people and countries were deceived. It is same old story.”

Nishimura, a Japanese Internet entrepreneur, said the rumors about Comet could be false: “Some people, who believe they do something good, may be deceived by false information.” But, he said, their motive was good; they “did it for saving children.”

On Connecticut Avenue, the hate calls and death threats kept mounting. Surely, the shopkeepers thought, this will all go away after the election.

On Election Day, Brittany Pettibone, a right-wing online activist in California who writes science-fiction novels with her twin sister, tweeted drawings of children under the label “Sexualized children, child abuse, pools, and bondage.” She wrote that the images were “a look inside Hillary Clinton’s friend Tony Podesta’s house.” Tony Podesta, a Washington lobbyist, is John’s brother.

Pettibone attached the hashtag #PizzaGate. “We need to expose this,” she wrote in another tweet.

Dozens of commenters responded almost immediately. “How do we make this VIRAL?” one wrote.

Several of the most frequent and prominent purveyors of the Pizzagate rumors said they first learned about the supposed conspiracy from Pettibone’s postings.

“I was one of the first,” Pettibone said in a brief conversation Tuesday. She said she would not take part in an interview: “I’m uninclined to speak to mainstream media because during the election cycle, they made the right look like nut jobs because we suspected Hillary had a health issue, and it turned out she did.”

For a few days after Donald Trump’s victory, a relative calm returned to Comet. But along the block, merchants were hearing from all manner of strange callers. At Besta Pizza, owner Abdel Hammad got an urgent message from the company that maintains his website. A reviewer alleged that his shop’s simple, pizza-shaped logo was a symbol of child pornography. Hammad, an Egyptian immigrant who voted for Trump, was stunned.

“It’s a slice of pizza,” he said.

Hammad removed the image from his site but could not afford more than $2,000 to pay for new signs out front.

“Why did you change the website?!” anonymous callers screamed at him on the phone.

“We’re going to put a bullet in your head,” one threatened.

Down the block, at Politics and Prose Bookstore, employees noticed tweets and other online posts that included them on a list of stores linked by underground tunnels that do not exist.

The fact that one of the shop’s co-owners, Lissa Muscatine, had worked as Clinton’s speechwriter and adviser for two decades quickly became one more data point in the Pizzagate activists’ conspiracy theory.

The shop’s phone rang off the hook with profane, abusive calls from across the country. Employees simply hung up, over and over.

Frustrated and frightened, merchants along the block talked to the police. They called the FBI, which said the threats were a local matter.

On Nov. 16, Jack Posobiec, a former Navy Reserve intelligence officer who had spent much of the previous year as a leader of a pro-Trump grass-roots organization, decided he’d had enough of just reading tweets and blog posts about the pizza place in his city.

Posobiec, 31, had never eaten at Comet; he had never even heard of the place until he started reading about it on conservative, antigovernment media sites. “I didn’t pay much attention to it before Election Day because I was focused on the campaign,” he said. “With that going on, who wants to talk about pizza?”

Now, with Trump elected, he read the posts more closely. Any story that accused Clinton, John Podesta and Brock of nefarious deeds deserved some investigation, he thought. He believed the Clinton campaign was “full of secrecy and deception.”

It seemed reasonable to Posobiec that Podesta might have organized a sex ring in cahoots with Brock. But the only part of the scenario that was real was that Podesta had been known to eat pizza at Comet. This part is false: pictures purporting to show that symbols, such as butterflies and spirals, in signs at Comet and other shops were statements about pedophilia.

Posobiec said he was curious and confused. He and a friend decided to go have some pizza. They walked into Comet eight days after the election, sat down and ordered. Posobiec got the garlic knots. His friend got a beer. But they were not just hanging out. Posobiec was using his phone to broadcast his evening at Comet on Periscope, an app that allows users to stream video live.

“Part of the experience of living in 2016 is live, on-the-scene broadcasts,” he said. “People have lost faith with government and the mainstream media being any real authority. After the Iraq War, after Benghazi, people are searching for other sources of information. If I can do something with Periscope and show what I’m seeing with my own two eyes, that’s helpful.”

Posobiec said he never made any disturbance inside Comet, but the restaurant’s managers saw him take his camera into a back room where a child’s birthday party was underway. It did not seem appropriate for a child’s party to be broadcast on a stranger’s Periscope feed. The manager asked two D.C. police officers who happened to be across the street to assist.

Posobiec and his friend “were gently refused service and asked to leave,” said a person familiar with the restaurant’s decision.

Posobiec offered to pay for what he had ordered. The manager said it was on the house.

Posobiec said he was not there to make a scene. “I didn’t have any preconceived notions,” he said. “I wasn’t sure. I thought I could just show it was a regular pizza place.”

That evening, after Posobiec was ushered out of Comet, Pettibone tweeted: “You’re my hero for doing this, Jack. Never let go.”

On Twitter, the hashtag #pizzagate peaked in the hours after Posobiec’s video appeared.

On Nov. 22, Reddit closed its “r/pizzagate” subreddit, a site forum focused on a particular topic. The site said it was concerned that Pizzagate posts were revealing private information about people at Comet and nearby stores. “We don’t want witch-hunts on our site,” it said. The decision sparked allegations of censorship from some people who were spreading the Pizzagate rumors. They moved their discussion to a similar site, Voat.

On Sunday of Thanksgiving weekend, two men carrying protest signs showed up outside Comet.

Alefantis went outside and offered the men coffee. They declined the offer.

On the phone and online, threats poured in, with as many as 150 calls a day.

The shopkeepers approached D.C. police for help. An officer advised them that the online ­rumormongering was constitutionally protected speech. Ousmaal replied in an email that she respects freedom of speech but that “derogatory libelous and hateful blogs and emails should not and cannot qualify.”

The officer, Anthony Baker, responded, “I don’t have anymore options to give unfortunately.”

A D.C. police statement issued Tuesday said that the department “became aware of the fictional allegations contained in the false news story last month; however, despite postings of offensive language, we did not receive reports of any specific threats. Officers advised the staff to immediately report to police any threats made against the establishment or individuals.”

Earlier this fall, in Salisbury, N.C., Edgar Maddison Welch saw some friends doing drugs and he started preaching at them, aggressively.

Danielle Tillman, 23, was the best friend of Welch’s girlfriend. She said she had just taken acid when Welch got upset, chanting Jesus’ name at her.

“He grabbed my hand and got in my face and was like, ‘Let the demons out of her,’ ” Tillman recalled. “It was super weird.”

Welch, known to friends as Maddison, had struck friends as a sweet young man who’d had trouble finding his way. He had dabbled in acting — his father ran a small movie studio out of his house — and in writing and firefighting. None of it stuck. He liked to hike, long stretches out West, through mountain ranges, over rivers, into national forests.

A few years ago, he told his hometown newspaper that through hiking, he had broken his addiction to the Internet.

But Welch had another habit. He was arrested several times on drug-possession charges and his name appeared on a forged prescription, according to police ­records. He was convicted of marijuana possession and public drinking and was sent to a ­substance-abuse program.

Friends say Welch, 28, in recent months grew far more outwardly religious. “He sees himself as someone who is a protector,” said his friend Charles Dobson, 28. “He is just a thrill-seeking guy.”

On his Facebook page, Welch has posted biblical verses and psalms, some related to the end of days, along with photos of his two children. “Only by your power can we push back our enemies,” one verse reads. “Only in your name can we trample our foes.”

A few years ago, Welch told a longtime friend and former roommate, Dane Granberry, about stories he had read online describing miles of secret tunnels under the Denver airport. Welch, who had also been fascinated by conspiracy theories about the Sept. 11, 2001, attacks having been staged by the United States, had become obsessed with the tunnels idea and spent long hours reading articles, watching videos and searching for details.

“He’s into doing his own research,” Granberry said. “I don’t think he has very much faith in the media, but none of us do.” Granberry said her friend needed to see things for himself.

On Friday or Saturday, Welch drove to the District, according to court testimony. He showed up at Comet on Sunday about 3 p.m.

Gareth Wade, 47, and Doug Clarke, 50, were sitting down for pizza and beer when a server told them that someone had walked in with a gun. As Welch passed by their table, he told them to vacate the building. They rushed out.

Outside, dozens of D.C. police officers swarmed the area, evacuating businesses and blocking off streets. A police helicopter circled overhead.

Inside Comet, Welch, armed with a Colt AR-15 assault rifle, a .38-caliber Colt revolver and a folding knife, fired his gun two or three times, police said.

Welch, dressed in jeans, a T-shirt and a hooded sweatshirt, remained inside for about 45 minutes, searching for underground vaults or hidden rooms, police said. At least one gunshot broke off a lock to a door. It led not to hidden sex workers but to a computer room. The bullet damaged a computer tower.

At some point, a Comet worker who had been in the back freezer retrieving dough and had missed the earlier commotion heard the shots and emerged into the restaurant. Welch swung the rifle in his direction and the worker fled out onto the avenue, police said.

Finally, Welch responded to police calls for him to leave the building and surrender. He put his AR-15 on top of a beer keg and his revolver on a table. He came out with his hands up, following police commands to walk backward toward them.

Welch was handcuffed, and Sgt. Benjamin Firehock asked him why he had done it. Welch said, according to the arrest affidavit, “that he had read online that the Comet restaurant was harboring child sex slaves and that he wanted to see for himself if they were there. [Welch] stated that he was armed to help rescue them. [Welch] surrendered peacefully when he found no evidence that underage children were being harbored in the restaurant.”

Within hours of Welch’s arrest, online conspiracy theorists had already decided that he was not one of them. Some suggested he was a “false flag,” a government plant — an enemy of their cause — who had been used in an elaborate plot to conceal the truth.

For years, people have made similar claims about everything from the 9/11 attacks (a government conspiracy to justify war, they say) to the Sandy Hook Elementary School shooting (a government conspiracy to justify gun control, they say).

Now, in Welch’s case, the conspiracy theorists insisted that the real news about his dangerous assault was, in fact, fake news.

Comet Ping Pong reopened Tuesday night; the crowd was large and supportive.

For some months now, Stefanie MacWilliams, 24, a stay-at-home mother of a 1-year-old boy in Ontario, has written nearly every day, usually about politics, for Planet Free Will, a conservative website based in the United States. Her husband, a mechanic, is the family’s main breadwinner, but Mac­Williams has been earning some money, too, writing a lot about how good Trump would be for America, and a fair amount about how bad President Obama was.

Starting in early November, MacWilliams noticed that stories based on the Podesta emails were making waves. A friend “who knows I’m interested in politics and shares conspiracy things with me” sent MacWilliams stories about Comet Ping Pong.

Then she happened upon Posobiec’s live stream from Comet. This, she decided, was a story. She told the Pizzagate tale in a YouTube video, on Twitter and on Planet Free Will.

In the third paragraph of her story, MacWilliams wrote that “we must stress that there is as yet no concrete evidence of any wrongdoing.” She thought she was being quite responsible. She had read Internet chatter about strange happenings and code words, and she thought this needed investigation. She was miffed that Posobiec had been escorted out of Comet when his video tour might have gotten to the bottom of the mystery.

MacWilliams’s story spread via social media. She became part of what she called a “worldwide citizen investigation” of Pizzagate.

When she saw Reddit and Twitter react to the conspiracy theory, respectively shutting down a discussion forum and suspending the accounts of some users, she worried that a coverup was underway. “As soon as you tell people they can’t talk about something, they’re going to talk about it a whole lot more,” she said.

MacWilliams calls herself a journalist, but she does not try to be “100 percent accurate,” either. She believes the beauty of the Internet is that people can crowdsource the truth. Eventually, what is real will emerge, she said.

Pizzagate, she said, is “two worlds clashing. People don’t trust the mainstream media anymore, but it’s true that people shouldn’t take the alternative media as truth, either.” The lack of stories about Pizzagate in the mainstream press meant that the back channels of the Internet would step into the breach.

But how does this end? What could constitute proof that there is no conspiracy? Some Pizzagate buffs want a video tour showing that there are no secret rooms or tunnels. Others say they would need more.

MacWilliams remains caught up in the thrill of the chase. “There is a camaraderie to it,” she said. “It is like sitting around with your friends saying, ‘What really happened to JFK?’ It is like a giant game, especially nowadays when you can crowdsource thousands of emails and figure out what’s going on. It’s like a real-life Kennedy assassination where all the stuff is at your fingertips, and it’s happening today.”

When the New York Times mentioned her site on Nov. 21 as a source of fake news, MacWilliams got a little angry, but she also had reason to smile: The traffic on Planet Free Will soared as never before.

The story is everywhere. Some Americans especially keen on Pizzagate find themselves being accused of being Russian stooges, or of working for hackers intent on disrupting the American political process.

In a small city north of Tel Aviv, in the small hours of the night, Avrahaum Segol, a New Yorker who emigrated to Israel 15 years ago, makes call after call back to Washington. He says he has never been to Comet Ping Pong, but he is burning with a need to know. He found the elderly woman whose family once owned the colorful neon sign that sits over Comet’s front door. Alefantis bought the sign from a defunct liquor store in Adams Morgan.

Segol called the woman and spelled out his baroque story. He quoted from an H.G. Wells story called “In the Days of the Comet,” and he wondered whether the symbols on the sign — crescents and stars — might reveal a message about sexual misdeeds or satanic rituals.

The woman listened to some of this, then told Segol, “You’re an idiot.” She hung up on him.

He is undeterred. He sends letters to the president of the United States and the chief justice, and to newspaper editors and reporters, and to TV and radio hosts. He calls The Post to explain how the Supreme Court’s ruling on same-sex marriage connects with the symbols on the Comet sign. He calls to explain why his family left him. He calls to say why the death of a former CIA chief may be connected to Pizzagate. He calls to ask whether the neighborhood around Comet is known for murderers and thieves.

“We’re living in such a queer time,” Segol said. He said his investigation of Pizzagate is “a work of art. I tell my kids, ‘There are no mysteries, only facts unknown.’ ”

He asks to be contacted by email, but he warns that he does not open emails unless he knows they are coming in advance. “It’s hard to trust anyone,” he said.

Keith L. Alexander, Jennifer Jenkins, Michael E. Miller, Faiz Siddiqui, Julie Tate and Craig Timberg in Washington and Rachel Weiner in North Carolina contributed to this report.