Then came a booming crackle Tuesday night that sounded like gunfire and sent hundreds of people fleeing down side streets, huddling under neon storefronts and pounding on the doors for help outside crowded theaters, including the Shubert.

Police quickly said a backfiring dirt bike was the source of the noise. But the scene of fear and chaos suggested a new level of national anxiety days after mass shootings in El Paso, Texas, and Dayton, Ohio, left 31 people dead.

“I imagine, you know, the Baby Boomer era, they knew what to do when there was a bomb siren. And people in California know to stand under a door if there’s an earthquake,” said Jamie Pillet, of Long Island, who was knocked down during the stampede. Now there is a new danger and an ingrained response: “I think that we all, as Americans, sort of know the drill.”

In Times Square on Wednesday morning, Tania Lundh, of Michigan, described what to her felt like a new normal: “It isn’t a heightened sense of fear, but of reality.”

In the commotion during Tuesday night’s scare, police said, at least 12 people were injured, ranging in age from a 12-year-old girl to a 79-year-old woman. One person had broken her wrist; another fractured his kneecap.

But the following day, Chief James R. Waters, who leads the New York City Police Department’s Counterterrorism Bureau, said the public’s reaction was understandable and, as fearful as it was, even proper.

“To the untrained civilian, it’s gunshots, and in a 24-hour news cycle and the tragedies of Dayton and El Paso, they’re not wrong,” he said. “We train the public, we ask the public, we implore the public — run, hide, fight. They did what we asked them to do.”

The news of recent events is in the front of people’s minds — and particularly in Times Square, literally in front of their eyes. “It’s on the screens. It’s on their iPhone. It’s in their pocket. You can’t escape it,” he said.

The heightened reaction to a false alarm in New York was one of several around the country in the days since the shootings. In Virginia, a USA Today building was evacuated Wednesday after a mistaken report of a person with a weapon.

In Utah on Tuesday night, the sound of a falling sign at a shopping mall sent people scrambling for cover and hiding in stores. At a fair in Yuba City, California, on Sunday, people were pushing and shoving each other, trying to flee after hearing a loud noise.

News like the mass shootings create lenses through which people interpret their surroundings and, in particular, loud noises, said Jay Van Bavel, an associate professor of psychology at New York University.

“If they’re hearing about all these mass shootings in public spaces, they’re more likely to interpret them as a gunshot,” he said. “Once other people start to interpret it that way, it affects your interpretation. No one actually saw the original stimulus.”

Officers posted in Times Square — part of a heavy, everyday police presence — noticed a group of six people with dirt bikes starting and revving their engines. When one of the bikes backfired, officers immediately identified the sound as just that, Waters said, even as the opposite response rolled through the crowd.

“People were screaming to get down, children crying, everybody grabbing hold of loved ones trying to run to safety,” one woman wrote on Twitter.

Workers at Forever 21 were suddenly faced with a stampede of people running into the store, herding them to a lower floor. Diners on a patio of Junior’s Cheesecake dropped their forks and ran inside as a crowd plowed past, knocking over chairs and overturning tables. Glasses shattered, spreading shards on the floor. People lost shoes that were left behind on the streets and in stores.

“It looked like a war scene in that M&M; store,” said Daniel Simmons, a ticket seller from Manhattan. “There were mismatched shoes all over the place.”

Anjalika Sharma, a mother visiting from San Diego with her family, was swept into a Gap store by the surging crowd and cowered in a men’s restroom.

“You know, I’m in the bathroom thinking, if he comes in, how am I going to throw my body?” she said. “Who can I protect? Do I save my daughter or my son?”

Theaters, where workers are trained on how to evacuate in the event of an emergency, were faced with the opposite situation — people trying to get inside.

“We were at ‘Hamilton’ when panicked civilians stormed the theater for safety,” one theatergoer wrote on Twitter. “Which caused the theater to stampede. We were crawling and hiding behind railings.”

On the stage of “To Kill a Mockingbird,” Keenan-Bolger, as Scout, looked on in disbelief as the pandemonium arose.

“This was terrifying for the audience who heard screaming & banging on the doors,” she wrote on Twitter, “so they hid or ran & tried to flee. It was terrifying for us because we didn’t know what was happening or what to do.”

An employee at the Imperial Theater said on Twitter that he was locked in a bathroom alongside 10 women, with the lights off: “I accepted it was my time to die.”

Andrew Barth Feldman, star of “Dear Evan Hansen” at the Music Box Theater, said on Twitter that the show’s audience was locked down in the theater while the cast stayed in their dressing rooms.

“People were sobbing, calling their loved ones, hiding behind seats,” he wrote.

Police and the mayor posted messages on Twitter stating that there was no active shooter.

“Times Square is safe and secure, but the panic and fear people felt tonight was all too real,” Mayor Bill de Blasio wrote. “Nobody should have to live in constant fear of gun violence.”

The incident is hardly the first case of mistaken panic and unrest in Times Square or other crowded destinations in the city. In September, the pop of someone stepping on an empty water bottle in Central Park set off a stampede at a crowded concert. But its timing fed into mounting anxieties that seem to have reached a new crescendo since the weekend’s attacks.

As one visitor to the city posted on social media: “The state of fear is insane.”

“This is the world we live in,” said Gideon Glick, who also appears in “To Kill a Mockingbird,” playing Dill Harris. “This cannot be our world.”

Sharma, who hid with her family in the Gap restroom, said her son asked her later if they could move to Canada.

“And we told him no,” she said. “We kept saying, ‘It’s a beautiful country.’ ”

This article originally appeared in The New York Times.