NEW YORK (PIX11) — Frank R. James, the suspected subway shooter who police say went on a rampage on the N train this week, was expected to appear in court Thursday on a terrorism charge.

James was arrested Wednesday on the Lower East Side after he called the NYPD CrimeStoppers tip line on himself, according to law enforcement sources. He told police he was inside a McDonald’s restaurant at East 6th Street and First Avenue, the sources said. 

Officers headed there after the CrimeStoppers tip but James wasn’t there, so the officers searched the neighborhood and found him nearby, officials said. A New Jersey man told PIX11 News he and his cousin spotted James walking on the street and alerted the police. He was taken into police custody near St. Mark’s Place and First Avenue around 1:40 p.m.

The manhunt for James ended roughly 30 hours after he allegedly put on a gas mask onboard an N train, opened gas canisters and started shooting subway riders as the train filled with smoke during Tuesday morning’s rush-hour commute. Terrorized and injured straphangers rushed off the train at the 36th Street station in Sunset Park.

Some victims were bleeding, others sobbed or screamed as they ran onto the platform, video showed. And ordinary New Yorkers became heroes as they stayed at the scene to help those who had been shot despite the danger and chaos. 

Ten people were shot, some of whom were described by police to be in critical condition, however, they were expected to survive. Another 13 people suffered injuries such as smoke inhalation. 

Hundreds of police and detectives were quickly on James’ tale. He was identified as a person of interest in the case on Tuesday evening. By Wednesday morning, Mayor Eric Adams said he was considered the sole suspect. 

“We were able to shrink his world quickly. There was nowhere left for him to run,” NYPD Commissioner Keechant Sewell said on Wednesday after James’ arrest.

Investigators were able to link James’ name to a U-Haul van sought in connection with the attack, officials said. A key was left behind at the scene of the shooting.

Police connected that to a U-Haul with Arizona plates, which they later located in Brooklyn. James had rented the U-Haul, police said. 

Surveillance video obtained by PIX11 News on Wednesday shows James after he allegedly parked the U-Haul van near Kings Highway in Brooklyn before the shooting occurred. Traffic cameras from the Verrazzano Bridge showed James arriving in the city in the U-Haul on the morning of the attack.

Investigators at the scene on Tuesday also found a legally purchased gun, which they said was fired 33 times onboard the train, a bag of fireworks, smoke canisters, and a bottle of liquid believed to be gasoline.

The U.S. Attorney of the Eastern District of New York has taken over the prosecution of the case. James was charged with terrorist attacks or other violence against a mass transportation system. However, officials noted he does not have ties to known terrorist organizations. The motive for the attack remained under investigation.