Police in the New York metropolitan area have been put on high alert to protect Jewish neighbourhoods after an hours-long gunbattle with two men around a Jersey City kosher market that killed six people.

The police shootout with two men armed with high-powered rifles erupted about noon on Tuesday in Jersey City, New Jersey's second-largest municipality directly across the Hudson River from Manhattan.

The six dead included three civilians, one police officer and both gunmen.

Jersey City police said initially the gunmen's motive was not known but Mayor Steven Fulop said on Tuesday night that two gunmen had deliberately targeted the Jewish JC Kosher Supermarket where the four-hour gunbattle played out.

"Based on our initial investigation (which is ongoing) we now believe the active shooters targeted the location they attacked," Mr Fulop said in a tweet.

"Due to an excess of caution the community may see additional police resources in the days/weeks ahead," he wrote.

"We have no indication there are any further threat(s)."

New York Mayor Bill de Blasio tweeted that while there was no known specific threat to the city, he had placed city police on high alert, in particular, to protect Jewish residents.

"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," he said.

Police had said earlier on Tuesday they believed the kosher grocery was randomly singled out by the gunmen.

Some local media reported the initial confrontation between the suspects and police near the Jersey City cemetery, more than a kilometre away from the supermarket, was linked to a previous homicide investigation.

The dead police officer was shot at the cemetery shortly before the shootout around the grocery began.

This is Det Joe Seals who was killed in the line of duty today! He was a husband and father of 5. He is a #Hero and died protecting the citizens of Jersey City! God Bless his family and all of the JCPD members! #JerseyCityShooting @JCPoliceDept pic.twitter.com/pvs62bb0af — NJ Chiefs of Police (@NJSACOP) December 10, 2019

The identities of the two gunmen were not immediately released.

US President Donald Trump said on Twitter: "Just received a briefing on the horrific shootout that took place in Jersey City, NJ. Our thoughts & prayers are w/ the victims & their families during this very difficult & tragic time."

In 2018, Pennsylvania man, Robert Bowers, 47, was arrested and accused of bursting into a Pittsburgh synagogue with a semi-automatic rifle and shooting 11 people to death.

The massacre at the Tree of Life synagogue was the deadliest attack ever on Jewish Americans in the United States.

Bowers faces the death penalty on multiple murder charges.