The man suspected of carrying out the weekend bombings in New York City and New Jersey has been charged over the shoot-out with police which led to his arrest.

Ahmad Khan Rahami is accused of attempted murder of a law enforcement officer, unlawful possession of a weapon and possession of a weapon for an unlawful purpose, prosecutors said. Bail was set at 5.2 million dollars.

The gun battle began yesterday after a police officer responding to a call about a hooded vagrant asleep in a bar doorway roused him - and quickly recognised the bearded face of perhaps the most wanted man in America.

Rahami - identified in an FBI bulletin just hours earlier as a man wanted over the bombings - pulled a gun, shot the officer and triggered the confrontation in the street that ended with Rahami wounded and in custody.

A bloodied Rahami was loaded into the back of an ambulance, just 50 hours after the first blast that started it all.

Rahami, 28, a naturalised US citizen from Afghanistan who lived with his Muslim family in Elizabeth, New Jersey, underwent surgery for a gunshot wound to a leg as authorities began drawing up charges in a case that spread fear across the New York area and revived anxiety about homegrown terrorism.

New York mayor Bill de Blasio said officials had every reason to believe the series of bombings "was an act of terror" though investigators said Rahami's exact motive was not yet clear.

Officials said they had no indication there are more bombs or suspects to find, though they warned that they are still investigating.

After a whirlwind investigation that put Rahami in custody in just two days, New York City police commissioner James O'Neill said on Monday: "I'm a lot happier today than I was yesterday."

The probe started when a pipe bomb blew up on Saturday morning in Seaside Park, New Jersey, before a charity race to benefit US Marines. No one was injured.

A shrapnel-packed pressure-cooker bomb similar to those used in the Boston Marathon attack then exploded on Saturday night in New York's Chelsea section, wounding 29 people, none seriously. An unexploded pressure-cooker bomb was found streets away.

Late on Sunday, five explosive devices were discovered in a rubbish bin at a railway station in Elizabeth, New Jersey.

On Monday night Rahami was charged in New Jersey with five counts of attempted murder of police officers in connection with the shoot-out and federal prosecutors are still considering charges over the bombings.

Rahami lived with his family above their fried-chicken restaurant in Elizabeth and his relatives have clashed with the city over closing times and noise complaints they said were tinged with anti-Muslim sentiment.

A childhood friend, Flee Jones, said Rahami had become more religious after returning from a trip to Afghanistan several years ago. But some of the family restaurant's customers said that while Rahami was devout, he was more likely to talk about his interest in cars than to mention faith.

William Sweeney, the FBI's assistant director in New York, said there were no indications Rahami was on any law enforcement radar at the time of the bombings.

Authorities zeroed in on him as the potential bomber after a fingerprint and DNA obtained from one of the New York sites and "clear as day" surveillance video from the bombing scene helped identify him, according to three law enforcement officials.

Five people were stopped on Sunday night in a vehicle associated with Rahami but were questioned and released, Mr Sweeney said. He would not say whether they might later face charges.

The law enforcement officials said at least one of Rahami's relatives was in the car, which appeared to be heading towards Kennedy Airport in New York after coming from New Jersey.

Linden mayor Derek Armstead said the break in the case came late on Monday morning, when a bar owner reported someone asleep in his doorway.

Jack Mazza, co-manager of nearby VCMR Truck Services, said the bar owner came over exclaiming about the sleeping man, and Mr Mazza walked over to see a man curled up with a sweatshirt hood pulled over his head in the rain.

"He looked like a bum," Mr Mazza said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.