ELIZABETH, New Jersey — Authorities said they apprehended Ahmad Khan Rahami, the 28-year-old wanted in connection with weekend bombings in Manhattan and Seaside Park, New Jersey, after a shootout Monday with police officers.

The bloody incident capped off a frantic 72-hour period in this region and beyond, marked by the dual bombings, a stabbing spree in Minnesota and then, Sunday night, the discovery of still more explosive devices at a train station in Elizabeth. Even as the widening probe into the bombings continued across the region, authorities sought to reassure residents that the bombings and additional explosives appeared to be the work of a lone person rather than a larger network.

Chris Bollwage, mayor of Elizabeth, told reporters that Rahami — whose last known address was in that city — had been taken into custody Monday in the neighboring city of Linden. Two police officers were shot during the encounter, according to authorities, one of them struck in their protective vest.

Rahami — a naturalized U.S. citizen born in Afghanistan, according to the FBI — was also shot and was taken away in an ambulance, officials said.

Television footage showed the suspect being wheeled into an ambulance, hands cuffed, eyes open. Rahami — who was shot multiple times — was taken to University Hospital in Newark for surgery, officials said. They did not elaborate on his condition after surgery.

Rahami was charged Monday with five counts of attempted murder of a law enforcement officer related to the gunbattle in Linden, said acting Union County prosecutor Grace H. Park. He has also been charged with two second-degree counts related to possession of a handgun. Bail for Rahami has been set at $5.2 million by a state superior court judge.

Police and the FBI had announced early Monday that they were seeking Rahami in connection with the bombings in New Jersey and Manhattan’s Chelsea district, though his role in the incidents remains unclear.

“We have every reason to believe this was an act of terror,” New York Mayor Bill de Blasio said at a news conference Monday afternoon on the bombings and Rahami’s arrest. Earlier in the day, he had said the investigation was leaning in that direction.

Authorities are not seeking any other individuals at this time, de Blasio said.

Now that Rahami is in custody, the investigation is shifting to focus on whether he acted alone and what his motivation may have been, said James O’Neill, the New York police commissioner.

William Sweeney Jr., assistant director in charge of the FBI’s New York division, said that authorities have found “no indication that there is a [terror] cell operating in the area.”

A federal law enforcement official said Monday that federal terrorism charges against Rahami are expected, adding that such charges are likely in both New York and New Jersey. In addition, Rahami is also expected to face criminal charges stemming from the gunbattle leading to his capture.

Preet Bharara, U.S. attorney for the Southern District of New York, said during the news conference Monday that his office and possibly its counterpart in New Jersey “will be working to put together as comprehensive and thorough a collection of allegations as makes sense.”

Another law enforcement official said that police had footage almost immediately after the explosion on Saturday in New York, along with “a number of different pieces of physical evidence” including fingerprints and DNA, though the official would not elaborate on which proved key in the investigation.

So far, the official said there is no information there are any additional devices remaining. As of Monday evening, it appeared Rahami had not spoken to investigators, the official said.

The manhunt for Rahami came after authorities took five people into custody Sunday night for questioning in connection with the Chelsea bombing — not long before law enforcement in New Jersey worked to render safe “multiple improvised explosive devices” discovered at a train station Sunday in Elizabeth, just across from Staten Island.

Federal law enforcement officials have told The Washington Post they believe all three cases involving explosives in New York and New Jersey to be linked. They would not say whether the five people taken into custody Sunday night and later released were linked to Rahami or how Rahami’s family fit in, if at all.

The developments sowed further concern about terrorism in the region and across the country. Already, police had been investigating three weekend incidents — including a stabbing attack in a Minnesota mall — that took place within a 12-hour period Saturday.

Law enforcement officials said they were investigating whether Rahami could have been influenced by international militant groups or the ongoing conflict in his homeland, though they have not specified whether he operated as a lone wolf or has deeper connections to international terrorist groups.

Authorities were able to pull fingerprints from the Manhattan bomb that did not detonate, according to U.S. Rep. Peter King, R-New York, who said he was briefed on details of the attack and shown the Chelsea bombing site by the FBI the morning after the explosion.

King said that investigators connected the bombs in New Jersey and in New York due to “similarities” in the explosives, among other things, and said that authorities used a cellphone attached to the bomb that did not explode and traced it to another cellphone.

Still, King said that even though the bomb was made by an apparent amateur, it appeared to be impressive. He said it’s a matter of luck that more people were not seriously hurt.

“The dumpster that was exploded was thrown down the street,” King, a member of the House Homeland Security Committee, said in an interview. “It was sent flying. You had ball bearings everywhere. If streets had been crowded, there would have been bad injuries. There were windows broken as high as the third floor. It did quite a bit of damage.”

King said that he has been told that Rahami’s “trips to Afghanistan changed him,” adding that the 28-year-old had also visited Pakistan at some point.

After Rahami was arrested Monday, details began to emerge about how authorities found him.

Linden Police Capt. James Sarnicki told a local NBC affiliate that officers responded Monday to a call about a person sleeping in the doorway of a local bar. When police approached the man, they noticed his resemblance to the images on the wanted bulletin for Rahami.

Police then ordered him to show his hands, Sarnicki said, and Rahami “pulled out a handgun and fired one shot at the officer, striking him in the abdomen. Fortunately, the officer had a bulletproof vest on, which sustained most of the round.” That officer returned fire, the police captain said, but Rahami walked away.

“I understand that the suspect was indiscriminately firing his weapon at passing vehicles,” Sarnicki said. Rahami was eventually shot by police “more than once and … taken down to the ground,” Sarnicki said.

During the exchange of gunfire, Linden Mayor Derek Armstead said, a bullet ricocheted off a police vehicle and grazed another officer. A third officer was treated for high blood pressure.

“All three are going to be fine,” the mayor said. “We’re grateful no one was hurt.”

A Linden resident who went to the scene of the arrest said he saw the suspect lying on the ground on his side, handcuffed and seemingly in pain. Within 10 minutes, more than 100 law enforcement officials swarmed the area, said the witness, who did not want his name used.

The two wounded officers were loaded onto ambulances and taken away first, and another ambulance took Rahami away 10 to 15 minutes later, the man said.

President Barack Obama spoke on the phone Monday with the two officers who were injured, according to the White House. He also spoke with an off-duty officer who shot and killed a man attacking people inside a Minnesota mall on Saturday, thanking all three officers for their actions in recent days.

Before the shootout in New Jersey involving the two officers, FBI agents had also launched an “operation” at an address on Elmora Avenue in Elizabeth, about a mile away from New Jersey Transit’s Elizabeth station. Court records show members of the Rahami family live and work at the address, where a restaurant called First American Fried Chicken is on the ground floor.

Court records show that several members of the Rahami family had owned and operated the restaurant since 2002. It is unclear when Ahmad Rahami lived there or what role — if any — he had in the business.

In 2011, the Rahami family sued the city of Elizabeth and several police officers, alleging they had been inappropriately cited for keeping their business open past 10 p.m. and harassed by police.

They alleged that a man in the neighborhood told them, “You are Muslims” and “Muslims make too much trouble in this country” and complained unfairly to law enforcement, who singled them out “solely on animus against [their] religion, creed, race and national origin.”

In one instance, they alleged, two Rahami family members were arrested for attempting to record a conversation with officers.

New York Gov. Andrew Cuomo told CBS News on Monday that “there may be a foreign connection” involving the bombing in Manhattan, though he did not elaborate.

About 8:45 p.m. Sunday, the FBI and the New York Police Department stopped what the bureau’s New York field office called a “vehicle of interest” in the Manhattan bombing investigation and took five people into custody.

On Monday afternoon, authorities said that the passengers in the car had been questioned by Joint Terrorism Task Force agents and detectives, but said they were not in custody and none had been arrested.

Law enforcement also combed an area around the train station in Elizabeth, where a backpack with “multiple improvised explosive devices” was found.

Bollwage, the Elizabeth mayor, said that up to five devices were discovered inside a backpack, and one of the devices — found around 8:30 p.m. Sunday — exploded as it was being disarmed shortly after 12:30 a.m. Monday. The New Jersey Transit rail system halted rail service near Newark Airport due to the police activity. Regular service was restored before dawn.

The mayor said Monday that two homeless men found the explosives. Thinking there would be something valuable in the backpack, they opened it — but found what appeared to be explosive devices and reported it to the police.

They were “on the side of the angels,” Bollwage said, noting that the men didn’t get blown up when they touched the bag. If the bombs had exploded hours later, during rush hour, “hundreds of people would have been killed and injured,” the mayor said.

Each of the weekend incidents — the discovery of the devices in Elizabeth, the bombing that injured 29 in Chelsea, an explosion along the route of a scheduled race in Seaside Park, New Jersey, and a stabbing that wounded nine in a St. Cloud, Minnesota, mall — raised the possibility of terrorist connections, prompting federal and local law enforcement to pour major resources into determining exactly what happened and why.

A news agency linked to the Islamic State claimed Sunday that the suspect in Minnesota, who was fatally shot by an off-duty police officer, was “a soldier” of the militant group, though there was no confirmation of what connection the man may have had with the terrorist group.

A claim of responsibility is no guarantee that the terrorist group directed or even inspired the attack, and authorities said they were still exploring a precise motive. The Islamic State made no similar claims about the New York and New Jersey incidents.

Those injured in the Saturday night blast in Chelsea had been released from hospitals by Sunday.

The Manhattan explosion occurred about 8:30 p.m. Saturday in the area of West 23rd Street between Sixth and Seventh avenues, injuring 29 people as it hurled glass and debris into the air, officials said. Surveillance video showed passersby running to get away from the blast, and investigators said they would comb through that and older footage to try to identify those responsible.

A short time after the explosion, just a few blocks away, police found another potentially explosive device, which looked like a pressure cooker with wiring, according to a law enforcement official who spoke on the condition of anonymity to discuss the ongoing investigation. Pressure cookers were used in the two bombs detonated at the Boston Marathon in 2013.

The incidents came as foreign leaders, including many heads of state, were heading to Manhattan for the United Nations General Assembly. Secretary of State John F. Kerry arrived Saturday, while Obama arrived in the city Monday.

The annual U.N. meeting — held more than two miles from the site of the explosion in Chelsea — is traditionally a challenging time for New York, as many roads are shut down and the heavy security leads to traffic jams. Officials said they had already prepared to beef up security, and now they would intensify those efforts.

Speaking in New York, Obama said there was no known connection between the stabbings in Minnesota and the incidents in New York and New Jersey. But the attacks only reinforced his resolve to continue fighting the Islamic State, both on the ground and online, he said.

“We will continue to lead the global coalition in the fight to destroy ISIL, which is instigating a lot of people over the Internet to carry out attacks,” Obama said, using one of the acronyms for the Islamic State. “We’re going to continue to enlist tech companies and community and religious leaders to push back against online extremist content and all messages of hate.”

The president also emphasized the need to be vigilant but cautioned citizens against giving in to fear.

“At moments like this, I think it’s important to remember what terrorists and violent extremists are trying to do: They are trying to hurt innocent people, but they also want to inspire fear in all of us and to disrupt the way we live and to undermine our values,” he said.

The Council on American-Islamic Relations, a Washington-based advocacy group, said Monday that it welcomed Rahami’s arrest.

“American Muslims, like all Americans, reject extremism and violence, and seek a safe and secure nation,” CAIR’s Executive Director Nihad Awad said in a statement. “Our nation is most secure when we remain united and reject the fear-mongering and guilt by association often utilized following such attacks. We stand together with our fellow Americans in New York, New Jersey and Minnesota as we deal with the troubling phenomenon of domestic terrorism.”

Washington Post writers Sarah Larimer, Philip Bump, Brian Murphy, Kristine Guerra, Sari Horwitz, Sean Sullivan, Steven Overly, John Wagner, Julie Tate, William Wan, Derek Hawkins and Cleve R. Wootson Jr. contributed to this report.