An Afghan-born American was charged Monday with attempted murder after being shot and captured in connection with bombings in New York and New Jersey, thrusting security fears into the heart of the election.

Saturday's attacks, which wounded 29 people in Manhattan and cancelled a US Marine Corps race in New Jersey, came on the same day that a Somali-American with possible links to the Islamic State extremist group went on a stabbing rampage in Minnesota, wounding nine people.

Ahmad Khan Rahami, 28, was initially spotted by a police officer outside a bar in Linden, New Jersey around three hours after the FBI released his mugshot and described him as "armed and dangerous."

Source: AFP

When the officer approached the suspect, he immediately whipped out a handgun and shot the officer in the torso, hitting his protective vest, said acting Union County prosecutor Grace Park.

In a subsequent police shootout, Rahami was shot multiple times outside an auto repair shop, several blocks west of the bar, she said.

The handgun was recovered at the scene and Rahami was taken to hospital where he underwent surgery, officials said.

Neither the first officer nor a second hit in the head by a fragment of bullet suffered life-threatening injuries, the prosecutor said.

Source: AFP

When the officer approached the suspect, he immediately whipped out a handgun and shot the officer in the torso, hitting his protective vest, said acting Union County prosecutor Grace Park.

Rahami was stretchered into an ambulance in the town of Linden, wearing a bloodied bandage on his right arm and moving his head moments after being taken into custody.

He was charged with five counts of attempted murder of a law enforcement officer and on two unlawful weapon possession counts, Park announced.

A judge set bail at $5.2 million.

Little is known about a suspect, who was not on the authorities' radar before the attacks. Born in Afghanistan, he worked at his family's fried chicken restaurant in Elizabeth, New Jersey, and is a US citizen.

Investigators will now focus on whether he had co-conspirators and on his motive in allegedly bombing New York's Chelsea neighborhood and detonating a pipe bomb along the route of a US Marine Corps race.

(Feature image source: AFP)