The man suspected of setting off smoke bombs and spraying gunfire inside a New York City subway car, injuring 23 people, was arrested on Wednesday, capping an around-the-clock manhunt.
He faces a federal charge of violently attacking a mass transportation system.
Frank Robert James, 62, was taken into custody in lower Manhattan, about 8 miles 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, police said.
James' arrest came 30 hours after an attack that erupted during the morning commuter rush as the Manhattan-bound N line train was pulling into an underground station in Brooklyn's Sunset Park community, renewing fears of violence in the city's subway system.
"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 (NYPD).
A 10-page criminal complaint filed by federal prosecutors on Wednesday in US District Court in Brooklyn charges James with a single count committing a terrorist or other violent attack against a mass transportation system.
If convicted, he could face life in prison, officials said.
He was scheduled to make his first court appearance on Thursday, the US Attorney's Office in Brooklyn said.
James is accused of setting 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 gasoline, according to police and court documents.
Police said 10 people were struck by gunfire, 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 of the victims were expected to survive.
The attack was the latest in a string of violent crimes unnerving passengers in the America's largest metropolitan transit system, including instances of commuters being pushed onto subway tracks from station platforms.
The issue has posed a new challenge for Adams, who has pledged to help rebuild passenger numbers that plunged during the coronavirus pandemic and ensure greater public safety.
Police said James was apprehended without incident in Manhattan's East Village neighbourhood after he was spotted 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.
"He had a bag and was walking on the sidewalk," Dahhan recounted. "I saw a lot of people come behind him. I said to the people, 'Please guys, please keep some space, this guy is going to do something.'"
Officers were initially dispatched to a McDonald's outlet on the basis of a hotline tip, then widened their search around the restaurant until he was located nearby a short time later, police said.
Authorities told reporters they were still investigating what James' motive might have been.
One focus of that inquiry, according to an FBI affidavit in the case, 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 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 in his name 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 then still at large, New Yorkers went about their daily commutes, saying the violence gave them pause but did not diminish their need for mass transit.