Ahmad Khan Rahami is arrested in Manhattan and New Jersey bombings

The man believed to be responsible for the explosion in Manhattan Saturday night and an earlier bombing in New Jersey, Ahmad Khan Rahami, was taken into custody Monday after he was wounded in a gunfight with police, law enforcement officials said.

The dramatic episode on a rain-soaked street in Linden, New Jersey, came after police issued a cellphone alert to millions of residents in the area telling them to be on the lookout for Rahami, 28, who was described as “armed and dangerous.”

The showdown started around 10:30 a.m. when a resident spotted a man sleeping in the doorway of a bar, officials said.

Capt. James Sarnicki of the Linden Police Department told reporters that an officer approached the man, later identified as Rahami, and when he woke him, he saw that he had a beard resembling that of the man on the wanted poster.

The officer ordered Rahami to show his hands, Sarnicki said, but instead, he pulled out a handgun.

He shot the officer in the abdomen, Sarnicki said, but the bullet struck his vest.

“The officer returned fire,” he said. Rahami fled, “indiscriminately firing his weapon at passing vehicles.”

Other officers joined the chase, and Rahami was shot multiple times. At least one other officer was injured during the confrontation.

Shortly after 11 a.m., Rahami was in custody, seen by witnesses splayed out beside the street, hands cuffed behind his back and his shirt rolled up, officers standing over him with their weapons drawn.

Rahami, blood pouring from a wound in his shoulder and splattered on his face, was loaded onto a stretcher and taken to University Hospital in Newark, New Jersey.

Rahami was identified by officials on surveillance video planting the bombs in Chelsea, both the device that exploded on 23rd Street and another that did not detonate a few blocks away. His fingerprint was also found on one of the pressure cooker bombs in Manhattan, according to a senior law enforcement official. Rahami was also connected to a bombing that took place earlier Saturday on the Jersey Shore.

The police believe that he was also responsible for a backpack full of pipe bombs found in Elizabeth, New Jersey, late Sunday.

President Barack Obama, who arrived in New York Monday to join other world leaders for the annual meeting of the United Nations General Assembly, made brief remarks on the attack.

“Folks around here, they don’t get scared,” Obama said. “They are tough, they are resilient, they go about their business every single day.”

He also warned of the dangers of exaggerating threats or spreading rumors.

Authorities began to focus on Rahami on Sunday as they reviewed hours of surveillance video taken from the Chelsea area.

On Sunday evening, increasingly confident that Rahami might be involved in the bombing, police rushed to act when they saw a car leaving an address associated with him.

The car was pulled over on the Belt Parkway near the Verrazano-Narrows Bridge in Brooklyn. Five people inside were questioned and later released.

Later on Sunday night, police got a report of a suspicious package near a train station in Elizabeth, New Jersey. The FBI, called in to investigate, dispatched a pair of robots to examine the bag and determined that it held five bombs, some of which were pipe bombs.

Around 12:30 a.m., the robots tried to clip a wire to disarm one bomb and accidentally detonated it. No one was injured.

The location of the bag was not far from where the Rahami family ran a restaurant, and before dawn federal agents and local police officers were swarming a residential neighborhood of low-rise apartment buildings, multiple-family homes and small businesses.

They searched the restaurant, First American Fried Chicken, and addresses where Rahami was reported to have spent time.

Even as police scoured the area near the Rahami restaurant, the suspect was seeking shelter from the morning rain under a doorway of a bar in the neighboring town of Linden.

Diego Jeronimo, 36, the owner of a store near where the gunbattle unfolded, said he opened his front door and saw a police car parked lengthwise across the street, an officer with his back to him with his gun drawn using the car as a shield. He heard around five shots.

“Then it calmed down a little bit, then we hear seven shots, but they were more distant,” down the block, he said.

Shawn Styles, 30, who works at Linden Auto Body next door, said he saw numerous police vehicles whiz down the avenue.

“Then multiple, multiple shots,” he said.

© 2016 New York Times News Service