After 29 hours in which the police combed the streets, scoured surveillance cameras, patrolled subway platforms and sent an alert to phones across New York seeking tips, the man accused of opening fire on a subway train in Brooklyn and injuring at least 23 people was arrested near a McDonald’s in the East Village on Wednesday, officials said.

The suspect, Frank R. James, 62, was taken into custody without a struggle about 8 kilometers from the station where he is accused of committing one of the worst attacks on New York’s subway system.

"My fellow New Yorkers: We got him,” Mayor Eric Adams said in a news conference Wednesday afternoon. "We got him.”