A man with a pipe bomb strapped to him set off the crude device in the subway near Times Square on Monday, injuring the suspect and three other people at the height of the morning rush hour.
The suspect was identified as Bangladeshi 27-year-old Akayed Ullah. While initially law enforcement officials said he was inspired by the Islamic State group, Ullah told investigators one of the motives behind the attack was Israel's actions in the Gaza Strip, as per CNN.
Ullah and three others—including a police officer—were being treated for non-life-threatening injuries in what the mayor and police labeled an attempted terror attack.
The explosion happened in an underground passageway under 42nd Street between 7th and 8th Avenues. The 7:30 a.m. blast caused smoke to fill the passageway, which was crowded with throngs of Monday morning commuters.
Mayor Bill de Blasio and Police Commissioner James P. O'Neill labeled it an attempted terror attack.
"Thank God the perpetrator did not achieve his ultimate goals," de Blasio said.
Ullah had no criminal record in Bangladesh and last visited his home country in September, Bangladesh's police chief said Monday.
Inspector General of Police A K M Shahidul Hoque said the information was based on the man's passport number.
The man was from the southeastern Bangladeshi district of Chittagong, Haque said. He last visited Bangladesh on Sept. 8.
Ullah had a black cab/limousine driver's license from 2012 to 2015, after which it expired, the New York Taxi and Limousine Commission said.
"It was two distinct explosions seconds from each other," Francisco Ramirez told CNN. "As I was making my way toward the outside, I kept getting shoved by cops and there were cops at every entrance blocking and there was police and SWAT everywhere. It was scary. It was just a lot of chaos but I didn't see any injuries."
New York City Mayor Bill de Blasio and President Donald Trump have been briefed on the incident, according to local media and the White House.
The bus terminal was temporarily closed and the A, C and E subway train lines were evacuated, the Port Authority of New York and New Jersey said in a Twitter statement.
New Jersey Transit buses headed to the Port Authority were diverting to other locations following the explosion.
NJ Transit says buses are taking passengers to Secaucus and Hoboken. From there, they can take trains or PATH into the city.
Trains, PATH, light rail and ferries are honoring bus tickets into New York.
News of the incident jarred financial markets as trading was getting underway for the week. Standard & Poor's 500 index emini futures pared gains, the dollar weakened against the yen and US Treasury securities prices gained on a modest flight-to-safety bid.
The incident occurred less than two months after an Uzbek immigrant killed eight people by speeding a rental truck down a New York City bike path, in an attack for which Islamic State claimed responsibility.
In September 2016, a man injured more than two dozen people when he set off a homemade bomb in New York's Chelsea district.
The Associated Press contributed to this report.