The man suspected of setting off smoke bombs and spraying gunfire inside a New York City subway car could face a life sentence after being charged with violently attacking a mass transportation system.
Frank Robert James, 62, was taken into custody in lower Manhattan, about 13 kilometres from the scene of Tuesday's assault, after authorities determined his whereabouts with the help of tips from residents, some of whom posted sightings on social media.
James was arrested 30 hours after the attack, which erupted during the morning rush-hour as a Manhattan-bound N line train was pulling into a station in Brooklyn's Sunset Park.
"My fellow New Yorkers, we got him. We got him," Mayor Eric Adams told a press conference announcing the arrest.
"We're going to protect the people of this city and apprehend those who believe they can bring terror to everyday New Yorkers."
James, a Bronx native with recent addresses in Philadelphia and Milwaukee, had nine prior arrests in New York and three in New Jersey, according to the New York Police Department.
A 10-page criminal complaint filed by federal prosecutors on Wednesday in Brooklyn charges James with a single count of committing a terrorist or other violent attack against a mass transportation system.
If convicted, he could face life in prison, officials said.
He is scheduled to make his first court appearance on Thursday.
Police will allege James set off two smoke bombs inside a subway car moments before opening fire on fellow passengers with a semi-automatic handgun.
The pistol, purchased in 2011, was later recovered from the scene, along with three extended-ammunition magazines, a torch, a hatchet, a bag of fireworks and a container of fuel, according to police and court documents.
Police said 10 people were struck by gunfire, with five of them listed in critical but stable condition on Wednesday. Thirteen others were injured in the frantic rush to flee the smoke-filled train. All are expected to survive.
The attack was the latest in a string of violent crimes unnerving passengers in the largest metropolitan transit system in the US, including instances of commuters being pushed onto subway tracks.
James was apprehended without incident in Manhattan's East Village after he was spotted - first at a fast-food restaurant and later on the street - by onlookers who recognised him from wanted posters and relayed his location to authorities.
"I said, 'Oh my God, this is the guy'," one bystander, Zack Dahhan, told reporters of his encounter with the suspect before he helped alert police in a nearby patrol car.
Authorities told reporters an investigation was continuing into what James' motive might have been.
One focus of that inquiry, according to an FBI affidavit, was a number of YouTube videos he posted addressing statements to New York City's mayor about homelessness and the subway system.
A YouTube account apparently belonging to James was taken down on Wednesday for violating the online video platform's "community guidelines", the company said.
Investigators initially linked James to the attack, the FBI affidavit said, when a sweep of the crime scene in Brooklyn's 36th Street subway station turned up a credit card with his name on it and keys to a rented U-Haul van later found parked two blocks from an N-train stop.
In addition to items found at the subway station, searches of James' apartment and a storage locker in Philadelphia uncovered more handgun and rifle magazines, ammunition, a Taser and a pistol barrel attachment for a silencer, the FBI said.
On Wednesday morning, with the gunman still at large, New Yorkers went about their daily commute.
"I was a little cautious but, hey, we're back to normal," passenger Matthew Mosk said on an N train that had just passed through the 36th Street station.
"NYC strong. Just like it never happened."