A 62-year-old man accused of shooting 10 people on the New York subway was taken into custody Wednesday and faces a federal terror charge, following a day-long manhunt in a city set on edge by the attack.

Frank James — who is suspected of detonating two smoke canisters on the train as it pulled into a Brooklyn station, before firing into the crowd — was stopped by officers on a Manhattan street and arrested without incident.

“My fellow New Yorkers: we got him,” Mayor Eric Adams told a news conference.

“There was nowhere left for him to run,” added New York Police Department commissioner Keechant Sewell, whose officers made the arrest acting on a tip.

Announcing the charges against James, US District Attorney Breon Peace said he could face a life sentence if convicted of violating a federal prohibition on “terrorist and other violent attacks against mass transportation systems.”

Michael J. Driscoll, the assistant director in charge of the FBI’s New York office, also characterized the shooting as “a terrorist attack on mass transit.”

No one was killed in Tuesday’s attack, which left 13 others injured in the scramble to get out of the station, or by smoke inhalation. The motive of the attack remains unknown.

James has nine prior arrests in New York, from 1992 to 1998, including possession of burglary tools and a criminal sex act, and was also arrested three times in nearby New Jersey for trespass, larceny and disorderly conduct, according to NYPD Chief of Detectives James Essig.

Police recovered a Glock 17 nine-millimeter handgun, three additional ammunition magazines and a hatchet from the scene of the attack, as well as James’ credit card and keys to a van he had rented. Officials said James bought the gun legally in Ohio.

He will be arraigned in a Brooklyn courthouse Thursday.

James had posted several videos of himself on YouTube delivering long, sometimes aggressive political tirades, as well as criticizing New York’s mayor. His page was taken down following the attack for violating YouTube’s guidelines.

But James’ sister, Catherine James Robinson, told The New York Times that she was “surprised” to see him named as a suspect, adding: “I don’t think he would do anything like that.”

She said she had had little contact with her brother for years, according to the newspaper.

The 36th Street station in Brooklyn, where the attack took place, was heavily patrolled by police on Wednesday.

“Today I was so reluctant, I actually tried to get a cab for like nearly maybe 20 minutes. I couldn’t find any and Uber was like $60 bucks, and so I was like ‘It’s okay, I’ll try my chance on the subway today,’” 38-year-old commuter Zeina Awedikian told AFP.

Others were more defiant. “No one is going to drive me away from the subway. The subway is in my DNA,” said 56-year-old Dennis Sughrue.

‘Shot in the back of knee’
According to the account given by police, James put on a gas mask just as the train was arriving at the station during the Tuesday rush hour, then opened the smoke canisters and fired 33 shots at the commuters packed on board.

“All you see is like a smoke, black smoke bomb going off, and then… people bum rushing to the back,” one of the gunshot victims, Hourari Benkada, told CNN, referring to a charge by passengers towards the door at the end of the car.

Benkada, speaking from his hospital bed, said he had boarded the first car at 59th Street and sat next to the gunman — but with his headphones on did not notice anything until smoke began filling the car.

He said he did not understand that there were shots at first and that he was trying to comfort a pregnant woman next to him.

“I got pushed and that’s when I got shot in the back of my knee,” he said.

Benkada said the shooting lasted for perhaps a minute.

The bullet went through his knee, leaving a hole “the size of a quarter,” he said. “I lost so much blood.”

Shootings in New York have risen this year, and the uptick in violent gun crime has been a central focus for Adams since he took office in January. Through April 3, shooting incidents rose to 296 from 260 during the same period last year, according to police statistics.

Lax gun laws and a constitutionally guaranteed right to bear arms have repeatedly stymied attempts to clamp down on the number of weapons in circulation in the United States, despite a majority of Americans backing greater controls.