A man has been found guilty of planting two pressure-cooker bombs that injured 30 people in New York in an attack said to be inspired by the so-called Islamic State.

Afghan-born Ahmad Khan Rahimi, 29, is facing a potential life sentence for the September 2016 attacks.

Prosecutors said Rahimi considered himself "a soldier in a holy war against Americans" and was inspired by IS and al Qaida.

One of the bombs injured 30 people after detonating on 23rd Street in the Chelsea area of New York. The other bomb did not detonate.

The US government said it was a miracle that nobody was killed by the explosives, which were packed with ball bearings intended to cause shrapnel wounds.

Rahimi, who lived in the Elizabeth, New Jersey, was caught on dozens of CCTV cameras as he dragged suitcases containing the improvised explosives and left them on the streets to go off.

Prosecutors said he had also planted a third pipe-bomb on the site of a Marine Corps charity race in Seaside Heights, New Jersey, hours before leaving the two pressure-cooker explosives.

No one was injured in the pipe-bomb blast because the race had been delayed. It was then cancelled.

Rahimi initially escaped after the attacks but was caught by police two days later, following a shootout.

Rahimi had denied all the charges against him, which included using a weapon of mass destruction and bombing a public place.

But he was found guilty after prosecutors produced a wide range of evidence linking him to the attacks.

He fingerprints were found on the bombs, and the CCTV evidence placed him firmly at the scene of the blasts.

Police also found a notebook found on Rahimi's person at the time of his arrest which they said contained a handwritten "claim of credit" for the bombings.

His defence team has said he will appeal the conviction.