Updated

The capture of an Afghani immigrant wanted for questioning in the bombings that rocked New York and New Jersey this weekend could be attributed to the quick thinking of one police officer.

Derek Armstead, mayor for the town of Linden, N.J., told Fox News on Monday afternoon that police officers in his community were able to apprehend Ahmad Rahami earlier in the day thanks to local police officer Angel Padilla’s quick thinking.

Angel Padilla

He told Fox News’ Shepard Smith that a resident had made a call to the local police department after seeing a man sleeping outside a local bar.

“A call was made, one of our police officers went to investigate, and our police officer noticed almost immediately that this was the suspect that was wanted for the bombings,” Armstead told Smith. "[Rahami] immediately shot, and our officer returned fire.”

More On This...

The mayor said Rahami got up and ran down the street, shooting “indiscriminately” at cars and police officers.

He said Rahami shot Padilla – who was wearing a bulletproof vest – in the torso before more officers joined in to the shootout.

Rahami, 28, was shot and injured in the leg.

Padilla was taken to University Hospital at Rahway while Linden Police Officer Pete Hammer, who was hit by flying debris and possibly shot as well, was taken to University Hospital in Newark. A third officer was taken to the hospital for examination for a blood pressure condition.

None of the officers had life-threatening wounds.

“Thank God Angel had his vest on,” Armstead said, according to mycentraljersey.com.

The arrest came just hours after police issued a bulletin and photo of Rahami, a naturalized U.S. citizen from Afghanistan who was living in Elizabeth, New Jersey.

Authorities said the blasts, which occurred in Elizabeth and Seaside, N.J., and in the Chelsea neighborhood of Manhattan, were looking increasingly like an act of terrorism with a foreign connection.

Police did not disclose how they zeroed in on Rahami as a person of interest in the bombing investigation.

Around the time Rahami was taken into custody, President Barack Obama was in New York on a previously scheduled visit for a meeting of the U.N. General Assembly, and said it was “extremely fortunate” nobody was killed in the bombings. He called on Americans to show the world “we will never give in to fear.”

“We all have a role to play as citizens to make sure we don’t succumb to that fear. And there’s no better example of that than the people of New York and New Jersey,” the president said. “Folks around here, they don’t get scared.”

Padilla is being hailed a hero for helping capture Rahami – and it’s not the first time.

In 2009, Padilla was involved in the capture of an Elizabeth man who was wanted for attempted murder.

According to NJ.com, Padilla was driving around Linden when he recognized 39-year-old Samuel Diaz, walking on a residential street.

As Padilla turned his vehicle around to get a closer look, Diaz pulled out a gun and shot himself. He was pronounced dead at University Hospital in Newark soon after.

On Monday, Armstead told Fox News that the town is shocked about the incidents that occurred, but happy that none of the town's police offices were seriously injured.

He said that Rahami was unknown to the people of his town before today.

"He was a complete stranger to us – totally off the radar," Armstead told Fox News. "But if you see something, say something – it should be order of the day for all of our citizens."

The Associated Press contributed to this report.

Like us on Facebook
Follow us on Twitter & Instagram