Officials said the violence, the worst in Jersey City in recent memory, involved three crime scenes: the cemetery, the rented truck — which they said might have been carrying an incendiary device — and the kosher market, which is next door to a synagogue and a school with more than 100 students. A prayer service had just ended there.

In an instant, soon after the gunfire began, there was chaos and confusion, as residents fled their homes. They stood, anxious, behind barricades as SWAT teams, bomb squads and heavily armed officers moved in.

It was not immediately clear what led to the confrontation at the cemetery in Jersey City, which is across the Hudson River from Lower Manhattan. But at the market, residents described a tense standoff with exchanges of gunfire. Willy McDonald, 67, said he heard “this constant shooting.”

“This is one of the biggest gunfights I’ve seen in a while,” he said, “and I’ve been in Vietnam.”

Another resident of the area, Corey McCloed, 39, said it seemed that Jersey City was under siege. And Orthodox Jews in New Jersey and New York followed the situation on Yiddish-language social media groups, said Yosef Rapaport, a Hasidic community leader from Borough Park, Brooklyn.

One video, narrated in Yiddish and shot from a second-floor window at the scene, showed an armored vehicle just after it rammed into the front window of the kosher market.

Moishe Ferencz, the owner of the market, JC Kosher Supermarket, had just left his store to take a quick break at a nearby synagogue, according to his mother, Victoria Ferencz. After a couple minutes, shots rang out. The synagogue was put on lockdown, and Mr. Ferencz’s thoughts turned to his wife, Mindy.

She had been left tending the market.

“I called my son, he says, ‘I’m locked here, I have no idea where she is,’” said Ms. Ferencz.