NEW YORK, Sept. 19 (UPI) — After an intensive manhunt that included police reaching out to millions of residents in the New York City metropolitan area, authorities on Monday captured the man they believe is responsible for an explosion in Manhattan this weekend that injured more than two dozen people.

The New York City Police Department had been looking for Ahmad Khan Rahami in connection to the Saturday night blast, as well as an earlier bombing in New Jersey. During the hunt, the NYPD issued a cellphone alert to millions of residents in the area with Rahami’s name and description.

Authorities cornered Rahami on Monday in Linden, N.J., after a tipster spotted him sleeping in the doorway of a bar and called police.

When a police officer arrived, the suspect pulled a gun and shot him in the abdomen area — but the bullet was stopped by his Kevlar vest.

“The officer returned fire,” Linden police Capt. James Sarnicki said, adding that Rahami also indiscriminately fired his weapons at passing vehicles.

Rahami was ultimately shot in the shoulder a short while later, as was a police officer, after he fled the area and was cornered by police. He was then arrested and hospitalized.

“Lot of — lot of gunfire,” Derek Pelligra, a manager at Linden Auto Body, told The New York Times.

“The response by the FBI, the ATF, fire department, EMS, the Port Authority and the state police, they all went into danger,” NYPD Commissioner James P. O’Neill, who assumed the post the day before the explosion, said at a news conference Monday. “I’m just so proud of what I saw.”

“A lot more information is coming in all the time,” New York Mayor Bill de Blasio said, adding that investigators are still gathering information. “We have every reason to believe this was an act of terror.”

Video: CBS News

Twenty-nine people were injured about 8:30 p.m. Saturday when a bomb exploded in New York City’s Chelsea neighborhood. Hours earlier, at about 10:15 a.m., a bomb had exploded at New Jersey’s Seaside Park; no injures were reported.

Investigators are now trying to determine is Rahami, a U.S. citizen originally from Afghanistan, was influenced by or has any connections to international militant groups.

According to the Times report, acquaintances said Rahami traveled to Afghanistan a few years ago and returned to the United States showing signs of radicalization. But it wasn’t immediately known why he made the trip.

Rahami’s last known address was in Elizabeth, N.J., where officials believe he was also responsible for a third bombing incident late Sunday at the train station there. The source of that blast, police say, was a backpack containing improvised explosives. No one was hurt.

The FBI launched a raid at Rahami’s nearby apartment, which is about a mile away from the train station.

President Barack Obama, in New York City Monday to attend United Nations General Assembly, said authorities “are extremely fortunate and grateful that nobody was killed.” He also praised the people and police of New York for their “resiliency,” de Blasio said.

“They are trying to hurt innocent people, but they are also trying to inspire fear in all of us,” Obama said of the perpetrators. “We all have a role to play as citizens in making sure we don’t succumb to that fear.”

New York Gov. Andrew Cuomo said in a statement that “no international groups have put out statements taking credit” for the explosions, but noted that it’s possible there’s could be a link to some foreign terror faction.