Ahmad Khan Rahami, the suspect wanted in connection with the Manhattan bombing, has been arrested in Linden, New Jersey, according to police sources.

Witnesses described seeing a man shooting at police cars before he was wounded and taken to hospital.

Officers also said they were investigating a suspicious package found nearby.

Earlier in the day, the FBI identified Rahami as the suspect in Saturday's bombing that wounded 29 people.

He was born in Afghanistan but became a naturalised American, living in Elizabeth, New Jersey, where his family complained they were being persecuted for being Muslim.

Stunned residents in the suburban town of Linden said they had been alerted by sirens and then the sound of shooting.

Vince Uvari, 70, who lived two streets away, said: "I heard the shots and I saw the police. I knew it was someting.

"I thought it was something to do with this because he lived in Elizabeth."

Ahmad Khan Rahami: Everything we know about New York bombing suspect

John Michelli, 68, who owns an electrical business in the area, said he had followed he news all weekend and suspected the various incidents involving explosive devices were linked.

"I think there is more to come. I am sure this is not the end of it, " he said.

"But I say go Trump. That is the only chance we have. What we are doing now is not working."

In pictures: New York bomb explosion Show all 25 1 /25 In pictures: New York bomb explosion In pictures: New York bomb explosion A police robot accidentally detonated one of five explosive devices left outside a train station in New Jersey. Officials said the bomb squad robot cut a wire on the mechanism in a bid to defuse it - but instead set off an explosion. The device had been left in a backpack and placed in a bin outside the train station in Elizabeth Universal News And Sport (Europe In pictures: New York bomb explosion A member of the New York City Police Department stands guard in Herald Square Getty Images In pictures: New York bomb explosion New York Mayor Bill de Blasio (3-R) and New York Governor Andrew Cuomo (2-R) tour the site of an explosion that occurred in the Chelsea neighborhood of New York Getty Images In pictures: New York bomb explosion New York Mayor Bill de Blasio and New York Governor Andrew Cuomo tour the site of an explosion that occurred in the Chelsea neighborhood of New York on September 18, 2016. The bomb that exploded in New York AFP/Getty In pictures: New York bomb explosion A genral view down the street near the site of an explosion that occurred in the Chelsea neighborhood of New York AFP/Getty Images In pictures: New York bomb explosion New York City Mayor Bill de Blasio (L) and New York Gov. Andrew Cuomo hug after touring the site of the bomb blast on 23rd St. in Manhattan's Chelsea neighborhood Getty Images In pictures: New York bomb explosion A mangled dumpster sits on the sidewalk at the site of an explosion that occurred in the Chelsea neighborhood of New York Getty Images In pictures: New York bomb explosion An explosion in a construction dumpster that injured 29 people is being labeled an "intentional act". A second device, a pressure cooker, was found four blocks away that an early investigation found was likely also a bomb Getty Images In pictures: New York bomb explosion New York Mayor Bill de Blasio (2-R) and New York Governor Andrew Cuomo (3-R) stand in front of a mangled dumpster while touring the site of an explosion that occurred in the Chelsea neighborhood of New York Getty Images In pictures: New York bomb explosion A member of the New York City Police Department K-9 Unit patrols on a subway train between Grand Central Terminal and Times Square Getty Images In pictures: New York bomb explosion FBI agents review the crime scene of remnants of bomb debris on 23rd St. in Manhattan's Chelsea neighborhood Getty Images In pictures: New York bomb explosion Members of the NYPD, FBI, ATF and other agencies investigate the the scene, following a late night explosion on West 23rd Street in New York AFP/Getty Images In pictures: New York bomb explosion Federal Bureau of Investigation (FBI) officials mark the ground near the site of an explosion in the Chelsea neighborhood REUTERS In pictures: New York bomb explosion New York Gov. Andrew Cuomo, right, walks from the scene of an explosion on West 23rd street in Manhattan AP In pictures: New York bomb explosion New York City Police Department (NYPD) officers stand near the site of an explosion REUTERS In pictures: New York bomb explosion Evidence markers on the street surround police and Federal Bureau of Investigation (FBI) officials near the site REUTERS In pictures: New York bomb explosion A fire truck is seen near a blocked off road near the site of an alleged bomb explosion on West 23rd Street AFP/Getty Images In pictures: New York bomb explosion New York City firefighters stand near the site of the explosion in the Chelsea neighborhood REUTERS In pictures: New York bomb explosion A New York City Police emergency services officer and his dog check a bin close to the scene EPA In pictures: New York bomb explosion New York City Police and Fire Department at the scene of the explosion EPA In pictures: New York bomb explosion A New York City firefighter uses a wheeled stretcher to carry supplies near the site of the explosion REUTERS In pictures: New York bomb explosion A New York City Police emergency service heavy weapons officer guards close to the scene of the explosion on 23rd Street between 6th and 7th Avenue EPA In pictures: New York bomb explosion New York Mayor Bill de Blasio, center, and NYPD Chief of Department James O'Neill, center right, speak during a press conference near the scene AP In pictures: New York bomb explosion New York City Police Emergency Services units are deployed on 27th Street and 7th Avenue where police found a second explosive device EPA In pictures: New York bomb explosion Police investigators look through the debris on the street in front of St. Vincent de Paul church where the explosion occurred EPA

A postman on his rounds said he heard 12-15 gunshots in all. He told CNN he thought the suspect was asleep in a doorway on the street when he was recognised by officers.

Police said they believed Rahami, 28, was linked to the bomb explosion in Chelsea after he was spotted on surveillance video nearby.

His arrest came shortly after authorities sent an alert to milions of people in the New York area warning them he was "armed and dangerous".

Authorities initially said there was no link to foreign terror organisations but changed their message on Monday morning after five pipebombs were also discovered at a railway station in Elizabeth, New Jersey.

Andrew Cuomo, governor of New York, said: "Today's information suggests it may be foreign related, but we'll see where it goes."