The New York Police Department (NYPD) has confirmed that the Monday morning explosion near Times Square was an act of terrorism. The perpetrator was identified as 27-year-old Akayed Ullah, said to have been inspired by Islamic State propaganda online.

WATCH LIVE: 3 injured, suspect arrested in Manhattan explosion (VIDEOS)

NYPD Commissioner James O’Neill called the blast a “terror-related incident” during a news conference. New York City Mayor Bill de Blasio also referred to the incident as an “attempted terrorist attack.”

"Let's be clear – this was an attempted terrorist attack. Thank God the perpetrator did not achieve his ultimate goals. Our first responders were there quickly and the only injuries we know of right now are minor," De Blasio tweeted following the attack.

"We are a target because we prove a society of many faiths and many backgrounds can work – we show democracy can work. But we are the most resilient place on earth. We've proved it time and time again," he continued.

We are a target because we prove a society of many faiths and many backgrounds can work – we show democracy can work. But we are the most resilient place on earth. We've proved it time and time again. — Bill de Blasio (@NYCMayor) December 11, 2017

When asked whether the suspect had ties to Islamic State (IS, formerly ISIS/ISIL), O'Neill said "he did make statements" but refused to elaborate.

ABC News reported that Ullah told the authorities he was inspired to carry out the attack by IS propaganda he accessed online.

Governor Andrew Cuomo confirmed that the attacker was inspired by IS. He was "disgruntled" and learned how to make a bomb online, Cuomo told CNN.

The explosion was caused by a crude pipe bomb strapped to the man, which injured him and four others when it went off in the subway corridor near Times Square during morning rush hour. He was also in possession of a second device, which did not detonate.

Surveillance cameras captured the man walking through the crowded passageway between 7th and 8th Avenue under 42nd Street when the bomb detonated at 7:20am local time. The suspect came to the US from Bangladesh seven years ago, according to AP. He worked as a taxi driver.

Ullah came to the US in 2011, on a F43 family visa, White House press secretary Sarah Huckabee Sanders confirmed on Monday, pointing out this was an example of "chain migration" President Donald Trump wants to abolish. F43 visas apply to children of brothers or sisters of US citizens who are at least 21 years of age.

.@DHSgov can confirm that the suspect was admitted to the United States after presenting a passport displaying an F43 family immigrant visa in 2011. The suspect is a Lawful Permanent Resident from Bangladesh who benefited from extended family chain migration. — Tyler Q. Houlton (@SpoxDHS) December 11, 2017

Elrana Peralty, a customer-service worker for Greyhound buses in the Port Authority, said she did not hear the explosion.

"All we could hear was the chaos," she said. "We could hear people yelling, 'Get out! Get out! Get out!'"

The NYPD, FBI and the FBI's Joint Terrorism Task Force are currently investigating the attack, according to NBC News.