Monday's attempted terror attack injured five New York commuters but its perpetrator, ultimately, appears to have failed in his aims.
Investigators are piecing together the weeks, days and moments leading up to the attack, in which a 27-year-old Bangladeshi man detonated a home-made device in a pedestrian subway tunnel in the heart of New York on a busy Monday morning.
Here's what we know so far about the explosion and failed attack:
The blast detonated around 7:20 a.m. in an underground walkway connecting two subway lines beneath the Port Authority Bus Terminal, near Times Square, which accommodates 220,000 passenger trips a day.
The suspect was first spotted on a security camera as he began to climb the subway station stairs to the 18th Avenue F. train platform in Brooklyn at 6:25 a.m., according to one law enforcement official with direct knowledge of the investigation.
He then switched to the A train at Jay St./MetroTech stop in Brooklyn before exiting the train at the Port Authority Bus Terminal stop in Manhattan, the same law enforcement official says.
On grainy surveillance footage, commuters are seen walking through a tunnel when a burst of smoke erupts into the hallway, quickly filling it. Commuters flinch and take cover. When the smoke clears, a man can be seen lying on the ground in the hallway.
The suspect has been named as 27-year-old Akayed Ullah, a Bangladeshi who has been living in the US since 2011 on an F43 family immigrant visa, according to Department of Homeland Security spokesman Tyler Houlton. He is a lawful permanent resident who lives in Brooklyn and has no criminal record in the US, according to a preliminary background check.
He had pledged allegiance to ISIS, according to one law enforcement official with direct knowledge of the investigation, and said he acted in response to Israeli actions in Gaza.
Ullah recently carried out electrical work close to the Port Authority along with his brother, who lives in the same apartment building as the suspect, according to law enforcement.
He is currently hospitalized at Bellevue Hospital, where he is being treated for lacerations and burns to his hands and abdomen, New York City Fire Department Commissioner Daniel Nigro said. He is said to be seriously injured.
From March 2012 to March 2015 Ullah held a Taxi & Limousine Commission (TLC) license, which had not been renewed, TLC spokesman Allan Fromberg said. It's unclear "whether he drove for any particular base, or whether he simply got the license but didn't drive at all," Fromberg said.
Ullah has no criminal record in his native Bangladesh, according to Sahely Ferdous, a Bangladesh police spokeswoman. Ferdous said Ullah last travelled to Bangladesh's capital Dhaka -- where he was born and raised -- in September, but police had no information on why he was there.
Ullah had at least two devices, a law enforcement source with knowledge of the investigation tells CNN.
Only one detonated -- a foot-long pipe that contained black powder, a battery, wiring, nails and screws. It was attached to Ullah with Velcro and zip ties. Investigators did not elaborate on the second device.
The suspect made the bomb last week at his apartment in Brooklyn, according to an official. New York Gov. Andrew Cuomo said it was an amateur, "effectively low-tech device."
The explosive chemical ignited, but the pipe itself did not explode, lessening its impact, Cuomo told CNN's Wolf Blitzer.
"Fortunately for us, the bomb partially detonated," he said. "He did detonate it, but it did not fully have the effect that he was hoping for."
Five people were treated for minor injuries in area hospitals.
"Mount Sinai Health System received and treated five patients with minor injuries as a result of the explosion today at Port Authority; four at Mount Sinai West and one at Mount Sinai Queens," a statement from the hospital group said.
"All were in stable condition and were release today. We are working closely with officials in law enforcement in the wake of this event."
Ullah was apprehended by Port Authority police officers shortly after the blast. Four of the officers involved in the apprehension and arrest of the suspect have been named as Sean Gallagher, Drew Preston, John Collins and Anthony Manfredini.
"Today, four courageous Port Authority police officers risked their lives confronting an armed terrorist to protect others from harm," Port Authority Police Benevolent Association President Paul Nunziato said in a statement.
"I am so thankful there was no loss of life and I could not be prouder of our Port Authority police officers, their actions and dedication to their sworn duty."
New York Mayor Bill de Blasio called the incident an "attempted terrorist attack," while Police Commissioner James O'Neill called it a "terror-related incident."
All subways and trains are running as scheduled, except the passageway where the incident occurred. Some exits and transfers may be blocked so passengers may be affected.
Gov. Cuomo praised the courage of the authorities, first responders and the city's residents.
"I am deeply grateful to the first responders and security personnel who kept people safe after today's attack and brought the suspect into custody," he said.
"Despite this morning's terrible incident, New Yorkers went about their lives unafraid, undeterred and more united than ever before. We will not allow this to disrupt us."
He added that he was directing the World Trade Center spire to be lit in red, white and blue "as a symbol of our essential values of freedom and democracy."
US President Donald Trump said Monday that an attempted terrorist attack in New York bolsters the need for his preferred immigration policies, which the White House says would have prevented the suspect from entering the country.