A man wanted for a series of bomb blasts in New York City and New Jersey was arrested last night after a gun battle with police.

A hunt started for Ahmad Khan Rahami, 28, after an explosion on Saturday evening that injured 29 people in the Chelsea district of New York.

The Afghan-born American was seen yesterday morning sleeping in a doorway in Linden, New Jersey, 13 miles southwest of Manhattan.

He shot at two police officers who tried to detain him before they returned fire, hitting him several times. He was arrested and taken for surgery.

Investigators said that he was “directly linked” to at least eight explosive devices used in New York and New Jersey, and that they were not seeking anyone else, The Times reported.

He was charged last night with five counts of attempted murder in relation to the shoot-out with police.

A fingerprint from the arrested man is thought to have been found on one bomb – made from a pressure cooker and shrapnel – that failed to go off in New York. Phones used in the devices are thought to have been used to trace him.

His last known address was in Elizabeth, New Jersey, where several bombs were found near the railway station. One exploded when police used a robot to try to retrieve it.

Rahami is also suspected of targeting a charity run planned in aid of the US Marine Corps in New Jersey on Saturday.