NEW YORK — Authorities on Monday arrested the man they believe responsible for the recent bombings in New York and New Jersey after a swift manhunt culminating in a shootout that wounded the suspect and two officers.

Prosecutors charged Ahmad Khan Rahami, a 28-year-old naturalized U.S. citizen and Afghanistan native, with five counts of attempted murder of a law enforcement officer. He is expected to face further charges in the bombings that set the New York region on edge over the weekend.

Law enforcement and New York City officials said Monday that they do not believe Rahami operated as part of a terrorist cell, and they were not actively seeking any other suspects. But they said they had more work to do to determine what motivated him and if anyone helped.

“We have every reason to believe this was an act of terror,” New York Mayor Bill de Blasio said.

Law enforcement officials said they believed Rahami was responsible for the bombing in New York’s Chelsea neighborhood Saturday night that wounded 29 and for the blast earlier that day along a scheduled race route in Seaside Park, New Jersey. No one was hurt in that incident, as racers had yet to pass the site.

Initially, officials said the disturbances had no obvious connections, and they shied from calling either one terrorism. The bombs used were somewhat different. In Chelsea, federal officials said, the perpetrator used two pressure cookers filled with shrapnel and ball bearings – one exploded, and one did not. In Seaside Park, pipe bombs were deployed.

But as investigators reviewed surveillance footage and analyzed the bombs, they came to believe that the incidents were related.

CELLPHONE FINGERPRINT WAS KEY

Rep. Peter T. King, R-N.Y., a member of the House Homeland Security Committee, said investigators “pulled fingerprints and the cellphone attached to the pressure cooker” and “traced that to another cellphone that he was going to call that from.”

They quietly zeroed in on Rahami, a 5-foot-6, 200-pound man whose family runs a fried-chicken joint in Elizabeth, New Jersey.

William Sweeney Jr., assistant director in charge of the FBI’s New York division, said Rahami was not previously on the bureau’s radar and that investigators were working to determine whether he was radicalized in some way or if there was some other motive.

Two federal officials said a fingerprint from a cellphone that was recovered proved key to identifying him. Officials also said they obtained DNA evidence from the crime scene. Federal law enforcement officials said that Rahami made several trips to Afghanistan and Pakistan over the past five years and that they were trying to determine whether he was radicalized abroad. One official said he was licensed to carry a firearm.

On the campaign trail, the Republican and Democratic presidential candidates seized on the incident to criticize each other. Democratic nominee Hillary Clinton said anti-Muslim rhetoric by Republican opponent Donald Trump was “giving aid and comfort” to the Islamic State.

“We know that a lot of the rhetoric that we’ve heard from Donald Trump has been seized on by terrorists, including ISIS, because they are looking to make this a war against Islam,” Clinton said, using an acronym for the Islamic State.

Trump said current anti-terrorism efforts are insufficient at home and abroad, and he blamed President Obama and Clinton, who served as Obama’s first secretary of state. Trump also suggested that profiling may be necessary to counter the threat.

“These attacks and many others were made possible because of our extremely open immigration system, which fails to properly vet or screen the individuals or families coming into our country,” Trump said during a campaign event in Estero, Florida.

Obama praised the fearlessness of the people in New York and New Jersey, noting that they continued going about their business.

“By showing those who want to do us harm that they will never beat us, by showing the entire world that as Americans we do not and never will give into fear, that’s going to be the most important ingredient in us defeating those who would carry out terrorist acts against us,” he said.

AUTHORITIES MOVE IN

Authorities began to make their move on Rahami on Sunday night. Near the Verrazano-Narrows Bridge in Brooklyn, they stopped a vehicle that had been spotted at a location associated with Rahami and took five people into custody, Sweeney said. King said two of those people were relatives of Rahami. The suspect, though, remained on the loose, and authorities believed him to be dangerous.

Sunday night, at a train station not far from the Rahami family’s home in Elizabeth, two homeless men found more explosives in a backpack, and in trying to render them safe, authorities inadvertently detonated one. No one was hurt. Federal law enforcement officials said they believe that Rahami was responsible for that incident, too.

The FBI searched the Rahami family’s home, above the chicken restaurant, and, for the first time, broadcast the suspect’s name and picture publicly.

About 10:30 a.m. Monday, they caught a break. A businessman spotted someone who he thought was a vagrant sleeping at his doorway in Linden, New Jersey, and called police, said Linden Mayor Derek Armstead. An officer went to wake the man, and Rahami lifted his head.

The officer immediately recognized him from the “be on the lookout” alert that was distributed, Armstead said.

The mayor said that within seconds, Rahami had fired a shot and hit the officer in the abdomen, though the officer was spared more serious injury by a bulletproof vest. The officer, Angel Padilla, returned fire, hitting Rahami in the shoulder and leg, Armstead said. He said another officer suffered a graze wound from a bullet that ricocheted off a car.

Rahami was soon taken into custody. Video and photographs showed him dazed, with an apparent shoulder wound, lying with his head against the pavement and then being loaded into an ambulance. As of Monday evening, Rahami had not spoken with investigators, a law enforcement official said.

In addition to the attempted-murder charges, Rahami faces two second-degree counts related to his possession of a handgun, said acting Union County prosecutor Grace H. Park.

Rahami was taken to University Hospital in Newark for surgery, officials said. They did not elaborate on his condition after surgery.

Bail for Rahami was set at $5.2 million by a state superior court judge.

Authorities said those taken into custody near the Verrazano-Narrows Bridge had all been released without charges.

Sweeney said that FBI agents were still working “to make sure we completely understand Rahami’s social network,” and New York Police Commissioner James O’Neill said the case was “still very much active.”