Two gunmen in Jersey City, NJ, who sparked chaos in a residential neighborhood when they exchanged gunfire with police in an hours-long shootout “targeted” the Jewish grocery store at the center of the melee, the city’s mayor said Tuesday.

Mayor Steven Fulop tweeted Tuesday night that authorities came to that conclusion based on their ongoing investigation into the shootout that left three civilians, a detective, and the two suspects dead.

“Based on our initial investigation (which is ongoing) we now believe the active shooters targeted the location they attacked,” Fulop wrote of the shootout in the Greenville section of the city.

“Due to an excess of caution the community may see additional police resources in the days/weeks ahead. We have no indication there are any further threats,” he added.

New York City Mayor Bill de Blasio condemned the attack and railed against anti-Semitism in several tweets after Fulop’s statement.

“This tragically confirms that a growing pattern of violent anti-Semitism has now turned into a crisis for our nation. And now this threat has reached the doorstep of New York City,” de Blasio wrote.

“Although there is no credible or specific threat directed against New York City, I have directed the NYPD to assume a state of high alert,” he added.

Detective Joseph Seals was killed in the gun battle that kicked off at about 12:30 p.m. when police responded to a report of gunfire near the supermarket on Martin Luther King Jr. Drive.

When police responded, they were immediately fired upon by the two gunmen, who were using long guns, authorities said.

At about the same time, police learned that a cop — later identified as Seals — had been gunned down on Garfield Avenue near Caven Point Avenue, about three-quarters of a mile away.

In addition to Seals, three civilians inside the supermarket and both suspects were killed in the shootout.

It’s not clear what Fulop meant when he said the store was “targeted,” but Police Chief Michael Kelly said earlier Tuesday the shooting was not believed to be terror-related.

A spokesperson for Fulop referred questions to the New Jersey Attorney General’s Office after he tweeted.