People said it sounded as if a war had broken out in their residential Jersey City neighborhood.

Two rifle-toting assailants had fatally shot a veteran police officer near a cemetery, then pulled their stolen U-Haul van up to a family-owned kosher market and opened fire again — igniting an hours-long gunfight with law enforcement that left six people dead, including the assailants and the police officer.

Jersey City Mayor Steven Fulop said the Jersey City Kosher Supermarket was “targeted.” New York Gov. Andrew Cuomo called it a “deliberate attack on the Jewish community.” And New York Mayor Bill de Blasio said the shooting “was an act of terror.”

Still, New Jersey Attorney General Gurbir S. Grewal said Wednesday that he could not confirm an anti-Semitic motive. The investigation is ongoing, he said at a news conference.

Meanwhile, Jews in the United States found themselves once again targets of gunfire, at a time when anti-Semitic acts have risen across the country.

The attack came a little more than a month after the one-year anniversary of a mass shooting at the Pittsburgh Tree of Life synagogue. Congregations in the Philadelphia region and elsewhere have spent the last year installing security measures like outdoor cameras and panic buttons, and sometimes hiring armed guards.

The deadly Jersey City shootout was a reminder of other places where Jews could be at risk.

“We’re not in the position at this time to say definitively why the suspects decided to stop in front of the supermarket and begin firing immediately,” Grewal told reporters Wednesday. “The why and the ideologies and the motivations, that’s what we’re investigating. ... We want to be thorough and we want to be accurate before we come back with more information.”

FBI agents found a “viable” pipe bomb in the attackers’ van.

Grewal identified the shooters — killed after a three-hour standoff with police — as David N. Anderson, 47, and Francine Graham, 50. Authorities said Anderson and Graham were prime suspects in the beating death of Michael Rumberger, 34, of Jersey City, whose body was found Saturday in the trunk of a car in Bayonne.

Officials believe the three victims in the kosher market — Mindel Ferencz, 31, a co-owner of the market with her husband; Douglas Miguel Rodriguez, 49, a store employee; and Moshe Deutsch, 24, a rabbinical student — were killed immediately after Anderson entered. A fourth person was shot but escaped and is recovering, Grewal said.

Ferencz and Deutsch were members of the tight-knit community of Satmar Hasidic Jews in Brooklyn.

Ferencz’s brother-in-law, Meir Ferencz, said she and her husband had moved to Jersey City about three years ago to be part of the small Orthodox Jewish community putting down roots there. He said his brother and sister-in-law had three children, the oldest of whom is 11. He called his sister-in-law “dedicated, a real mother, and a real wife.”

Rabbi David Niederman, executive director of the United Jewish Organizations of Williamsburg, a large community service organization in the Satmar community in Brooklyn’s Williamsburg section, said the Ferencz family were among the first of about 75 to 100 Hasidic families from Williamsburg to move to Jersey City over the last few years.

Deutsch, 24, lived in Williamsburg but happened to be in the Jersey City store Tuesday, Niederman said. He was the son of Abraham Deutsch, a leader in Williamsburg’s Satmar community. Niederman said Moshe helped his father organize a food drive that fed 2,000 families during Passover the last several years.

Mordechai Rubin, a member of the local Jewish emergency medical services, said next to the store is a synagogue with a school and day-care center where 40 students were present at the time of the shooting.

Mayor Fulop said the Jersey City Kosher Supermarket was the shooters’ target, and investigators said they believe the attack was driven by anti-Semitic and anti-police sentiments that one of the assailants had posted online, a law enforcement official told the New York Times on Wednesday. One of the assailants, the Times reported, also appeared to be linked to the Black Hebrew Israelite movement, which the Southern Poverty Law Center labels a hate group.

Investigators believe that Anderson and Graham — who were believed to be a couple — identified themselves in the past as Black Hebrew Israelites, a movement whose members have been known to rail against whites and Jews, according to a law enforcement official who was briefed on the matter but was not authorized to discuss the case publicly and spoke on condition of anonymity.

In addition, authorities found social media postings from at least one of the killers that were anti-police and anti-Jewish, the official said. The FBI on Wednesday searched the Harlem headquarters of the Israelite Church of God in Jesus Christ, which is the formal name of the Black Hebrew group, according to the official.

“The increase in antisemitism, particularly violent antisemitism, is extremely alarming and cannot be permitted to go unchallenged,” the United States Holocaust Memorial Museum said in a statement. “Countering it requires Americans of all backgrounds to confront it. As the Holocaust teaches, antisemitism is a virus and a threat not only to Jews, but to society as a whole.”

Grewal and Gov. Phil Murphy denounced hate and encouraged any faith groups with security concerns to contact state police.

“An attack on our Jewish community, or for that matter on any community, in what is by many measures the most diverse state in the United States,” said Murphy, “that attack is an attack against all nine million of us who are proud to call ourselves New Jerseyans. Period.”

Murphy said that he prayed Wednesday morning at the synagogue next door to the supermarket and that a state interfaith council had met Wednesday.

Grewal noted the extraordinary diversity of the city, where a kosher supermarket stands across the street from a Catholic school, down the block from a Dominican bodega, on a street named after Martin Luther King Jr.

“Jersey City is an American city, a city that reflects the values and the strength of our nation,” he said. “Yesterday that city came under attack — not just the city but the values that the city stands for.”

Grewal said the community would show “that we are stronger than the hate that fueled this terrible tragedy.”

Officials said scammers had set up fake GoFundMe sites that purportedly sought to raise money for the victims’ families. Those sites were under investigation.

Jersey City Police Detective Joseph Seals, 40, a 15-year law enforcement veteran and a married father of five, confronted the attackers and was killed in the shootout. Jersey City police officials said Seals led the department in removing illegal guns from the streets in recent years.

The Jersey City Kosher Supermarket, which opened three years ago in the gentrifying neighborhood, is the place where about 100 Hasidic Jewish families get their groceries.

“Once again, our nation is faced with scenes of carnage, fear, hopelessness, and loss,” Sen. Cory Booker (D., N.J.) said in a statement after the shooting. “There should be no place in America where residents are gunned down while shopping for groceries, officers are slain while protecting our communities, and children are sheltering in place at school.”

“The report from the Jersey City mayor saying it was a targeted attack makes us incredibly concerned in the Jewish community,” said Evan Bernstein, regional director of the Anti-Defamation League. “They want answers. They demand answers. If this was truly a targeted killing of Jews, then we need to know that right away, and there needs to be the pushing back on this at the highest levels possible.”

This article contains information from the Associated Press.