Was he working alone, and what was the motive?

These were the two pressing questions confronting authorities in New York - a city both tense and under massive security - as officials started trying to question the man they believe was responsible for a string of explosions that rocked the region.

Ahmad Khan Rahami, a 28-year-old Afghanistan-born American, was taken into custody on Monday morning following a shootout with police in the New Jersey town of Linden. Officers had been alerted by a bar owner who discovered a man sleeping in the doorway of his premises and thought he was a vagrant.

Mayor Bill de Blasio and Governor Andrew Cuomo at the scene of the New York blast (Getty Images North America)

Mr Rahami shot and injured two police officers, and he was himself shot several times before he was detained, taken to a local hospital and dispatched for surgery. The injuries of the New Jersey officers were not serious.

Late on Monday, Mr Rahami was charged in New Jersey with five counts of attempted murder of police officers in connection with the shootout and was held on $5.2 million (£4m) bail. Federal prosecutors said they were still weighing charges over the bombings.

Just hours after the bloodied and bandaged Mr Rahami was taken away in an ambulance, the body language of New York Mayor Bill de Blasio suggested a sense of relief.

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

“There is no other individual we’re looking for at this point in time,” he said at the press conference, during which he said officials were not aware of a direct threat to New York. “We have every reason to believe this was an act of terror.”

Yet despite the satisfaction among officials for having quickly caught the man they believe was responsible for a series of explosions, including one in New York on Saturday evening that left almost 30 people injured, on Monday night there were as many questions as answers. Reports said that the man in custody was "not cooperating".

As New York prepared to host leaders from around the world attending the UN General Assembly, a portrait of the suspect emerged as a man whose attitude and outlook had changed, and darkened, over the last couple of years. Local media said the man who lived and worked with his parents above a fried chicken shop, had grown a beard and started wearing traditional Muslim clothes, after a series of visits to Afghanistan and Pakistan.

A surveillance image showing naturalised US citizen, 28-year-old New Jersey resident Ahmad Khan Rahami (EPA)

CNN said Mr Rahami travelled to Afghanistan multiple times, according to law enforcement sources. He was questioned every time he returned to the United States, as is standard procedure, but was not on the radar as someone who might have been radicalised.

It said that Mr Rahami travelled to the Afghan city of Kandahar and to the Pakistani city of Quetta. Quetta is a stronghold of Islamic extremists, but also home to a large popoulation of Afghan refugees.

Reports said that while he was in Quetta in July 2011, he married a Pakistani woman. When he was questioned by immigration officials on his return to the US, he said he was visiting family and attending his uncle’s wedding.

He made a second trip to Pakistan two years later, and stayed there for a year, as did his brother, Mohammad.

Police chief and residents speak of Ahmed Rahami capture

Investigators said they were still searching for a motive for the blasts, which could have caused far greater damage had they been set off among larger crowds. Experts said officials had revealed that several of the devices contained Hexamethylene triperoxide diamine, or HMTD.

They said the compound was not commonly used in homemade bombs and suggested that may carry some clue for investigators.

In the New Jersey neighborhood where Mr Rahami lived with his family, residents expressed both shock and fear. Marcella Perrotti, a hair stylist, said she had visited the First American Fried Chicken shop only once and had not found a warm welcome.

Loading....

“He kept himself to himself,” she said of Mr Rahami, who in 2011 sued the police for allegedly subjecting him and his family to discrimination and “selective enforcement”. “We’re all friends here, we all talk to each other. But he didn’t.”

Joseph Fioretti, a military veteran, said he refused to allow such incidents stop him going about his business. “You have to keep doing your daily routine,” he said. “You can’t let [them] win.”

Flee Jones, 27, who said he'd known Rahami since they were teenagers, told reporters that he had noticed a change in Mr Rahami's personality after a trip to Afghanistan in 2014. When Rahami returned, he “got more religious” and dressed differently than before, Jones said.

“He was more quiet and more mature,” Mr Jones said. “I said, 'Oh, where have you been?' And he said, 'Oh, vacation.' But I knew he went to Afghanistan because his little brother said it.”

Mr Rahami also reportedly had a passion for Honda Civics that were custom-built to race.

Salaam Ismial called on fellow Muslims to denounce such atrocities (Andrew Buncombe ) (Andrew Buncombe)

Ryan McCann, a regular at the restaurant, told the New York Times he last ate there two weeks ago. “He was having a conversation about his cars,” Mr McCann said. “How he likes to soup ’em up and race ’em.”