The suspect wanted in connection with bombings in New York City has been taken into custody after a firefight with police.

Ahmad Khan Rahami, 28, was arrested in New Jersey on Monday hours after he was publicly identified as the suspect in connection with explosives planted in New York City and New Jersey state.

Rahami - an Afghan immigrant who lives in Elizabeth, New Jersey - was taken into custody after firing on police officers, Elizabeth Mayor Chris Bollwage said.

Two officers were shot in the encounter, an anonymous law enforcement official told the Associated Press news agency. They were expected to survive, the official said.

Investigators believe more people were involved in the New York and New Jersey bomb plots, two US officials told Reuters news agency.

A bomb went off on Saturday in Manhattan's Chelsea neighbourhood, injuring 29 people. All of the wounded have since been released from the hospital.

A homeland security official told Reuters news agency on Monday that five devices found in New Jersey early on Sunday were connected to Saturday's blast in Manhattan. 

The five explosive devices were found in a backpack near a New Jersey train station on Sunday night.

One of the five devices exploded early on Monday morning as authorities worked to disarm it. 

In a statement on Monday, New York Governor Andrew Cuomo said the investigation "suggests [the explosion] may be foreign related, but we'll see where it goes".

On Sunday, Cuomo had effectively ruled out a link to international terrorism, saying there was no evidence to suggest it.