The mayor of Jersey City, New Jersey, said a shootout that unfolded there Tuesday was the result of a "targeted" attack on a kosher grocery store. The standoff lasted several hours in a busy neighborhood, which also includes a synagogue and a school.

A police detective and three people in the store were killed, as were the two suspects.

"Last night after extensive review of our CCTV system it has now become clear from the cameras that these two individuals targeted the Kosher grocery location on MLK Dr," Mayor Steven Fulop tweeted Wednesday morning. He added that police officers prevented the suspects from leaving the location and harming more people.

The civilians killed in the prolonged shootout have been identified as 31-year-old Mindel Ferenz, 49-year-old Douglas Miguel Rodríguez and 24-year-old Moshe Deutsch.

The suspects were identified as 47-year-old David N. Anderson and 50-year-old Francine Graham, who are also deceased, the attorney general of New Jersey announced Wednesday.

The grocery store is a central fixture in the Orthodox Jewish community that has been growing in Jersey City, across the river from New York City's Financial District, over the past few years.

One witness described the shootout as "a war zone," the likes of which he said he'd never experienced in his life.

Police in Jersey City said it would be a while before the neighborhood returns to normal. "The investigation will take weeks, maybe months," Police Chief Michael Kelly said. "The crime scene is very extensive and is at three locations, at least."

The shootout began at a cemetery just after noon, where officers confronted two people they believed looked suspicious. That's when one of the officers, Detective Joseph Seals, was shot. The gunmen then got into a stolen rental van and drove themselves to the kosher grocery store where the standoff continued for hours. SWAT teams and helicopters swept the area as gunfire was exchanged.

Detective Seals, a 13-year veteran who focused on combating gun violence, was later confirmed dead by police.

"He was also a husband and a father of five children, so it's a tough day for Jersey City," Fulop said.

Police said the three bystanders who died were shot by the suspects.

"Just the sight of this in the area that I live in is very unnerving," said one resident.

Schools were locked down for several hours, sending parents into a panic. "I got a call from my daughter that they told the kids that there was an active shooter in the area and that they were going on lockdown," said Juan Cabrera.

Two other police officers were wounded but were in good condition on Wednesday morning. Fulop said people might see additional police resources in the days and weeks ahead, but said there was no indication of any further threats.

"The AG's office and HCPO will handle the formal investigation," he tweeted.

Don Dahler contributed to this report.