WASHINGTON — A man fired a rifle on Sunday inside a Washington pizza restaurant that has been subjected to harassment based on false stories tying it to child abuse, the police said. No one was hurt, and the man was arrested.

The man, Edgar M. Welch, 28, of Salisbury, N.C., told the police that he had come to the restaurant, Comet Ping Pong, in northwest Washington, to “self-investigate” what is being called Pizzagate, an online conspiracy theory asserting, with no evidence, that the restaurant is somehow tied to a child abuse ring. He entered the restaurant shortly before 3 p.m. with a rifle and fired it at least once inside, the police said.

The gunfire sharply escalated what had already been a tense period for the restaurant, its employees and the quiet neighborhood since the fake stories began spreading. Dozens of threats against employees had been made via email and social media.

People inside the restaurant fled, and the police locked down the area, ordering patrons of a nearby bookstore and cafe called Politics and Prose to remain locked inside. Officers with rifles and protective gear surrounded the restaurant and apprehended Mr. Welch. Two additional firearms were found, one on Mr. Welch and the other in his vehicle, the police said.