JERSEY CITY-Six people, including a police officer and three bystanders, were killed in a furious gun battle Tuesday that filled the streets of Jersey City with the sound of heavy fire for hours, authorities said.

The dead included the two gunmen, Jersey City Police Chief Michael Kelly said.

The slain officer, Detective Joseph Seals, 40, was credited by his superiors with having led the department in the number of illegal guns removed from the streets in recent years, and might have been trying to stop an incident involving such weapons when he was cut down by gunfire that erupted near a cemetery, authorities said.

The shooting then continued at a kosher supermarket about a mile away, where five more bodies were found, Kelly said. Authorities believe the Jewish market was targeted by the gunmen, Jersey City Mayor Steven Fulop tweeted Tuesday night. Fulop, whose public safety director said earlier in the day that terrorism wasn’t suspected, did not elaborate on why authorities now believe the market was targeted.

Messages were left Tuesday night seeking comment on Fulop’s tweet. “It’s a really tough day for the city of Jersey City,” Fulop said. Seals “was one of the best officers for getting the most guns off the streets. He was a good cop.”

Two other officers were wounded but were later released from the hospital, authorities said. The bullets started flying early in the afternoon in the city of about 270,000 people, situated across the Hudson River from New York City. Seals, who worked for a unit called Cease Fire, was shot around 12:30 p.m. The gunmen then drove a stolen rental van to another part of the city and engaged police in a lengthy shootout.

Kelly said when police responded to the area of the kosher store, officers “were immediately engaged by high-power rifle fire.”

A video shot by a witness shows a police officer on the ground by a car, apparently wounded. Another officer goes to him, helps him up and the two run around a corner as gunshots ring out. Seconds later, as a police cruiser pulls up in front of the store, about a dozen shots are heard in rapid succession. “Our officers were under fire for hours,” the chief said.

Inside the grocery store, police found the bodies of who they believed were the two gunmen and three other people who apparently happened to be there when the assailants rushed in, authorities said. Police said they were confident the bystanders were shot by the gunmen and not by police. The kosher grocery is a central fixture in a growing community of Orthodox Jews who have been moving to Jersey City in recent years.

Chabad Rabbi Moshe Schapiro, who shops at the kosher store and attends a synagogue next door, said he spoke with the store owner, Moishe Ferencz. “He told me he had just walked out of the store into the synagogue not five feet away just before this happened, and then he couldn’t get back for hours,” Schapiro said. “His wife was inside the store. He said, ‘I hope my wife is safe.’”