The man accused of shooting 10 people on a rush hour subway train in Brooklyn has been arrested in the East Village, officials said.

Frank Robert James, a 62-year-old former machinist with a history of misdemeanor crimes, was taken into custody shortly before 2 p.m. Wednesday, capping off a more than 24-hour manhunt for the suspected gunman behind one of the worst acts of violence in the subway system’s history.

Police officials said during a Wednesday press conference they'd received a Crimestoppers tip that James had been spotted at a McDonald's on 6th Street and First Avenue. James was gone by the time officers from the 9th Precinct responded, but they soon spotted him several blocks north at the intersection St. Mark's Place. They arrested him without incident. A passerby captured James's arrest.

It later emerged in reports from the New York Post, that were later confirmed by the Associated Press, that James called the police to report his own whereabouts.

Shortly after the suspect's capture, East Village residents swarmed around a 21-year-old security camera installer Zack Tahhan, who said he helped flag police down when he noticed the suspect walking by.

“We hope this arrest brings some solace to the victims and the people of the City of New York," said NYPD Commissioner Keechant Sewell, announcing James's detention.

Mayor Eric Adams joined the press conference remotely as he's still in quarantine with COVID-19 adding, "We got him."

Federal prosecutors said he will face charges of a terrorist attack on mass transit in Brooklyn federal court. Information about an attorney representing James wasn't immediately available.

While riding a Manhattan-bound N-train on Tuesday morning, James allegedly donned a gas mask, detonated two smoke devices and fired 33 shots into the crowded subway car from a 9mm Glock he legally purchased in Ohio in 2011, police said.

When the train pulled into the 36th Street station in Sunset Park, videos showed bloodied victims collapsed on the platform and the floor of trains. James evaded capture for more more than 24 hours after slipping away from the chaotic scene of the attack. Police said after the shooting, he boarded a train across the platform, got off at the next station and was then tracked through surveillance footage about an hour later, getting back onto the subway in Park Slope.

Authorities did not learn of his whereabouts from that point until receiving a crime-stoppers tip that he was at a McDonald’s on 1st Avenue in the East Village. Zack Tahhan, a 21-year-old who was installing security cameras at an apartment nearby, said that he saw James standing in the street next to his suitcase, and quickly flagged down an officer.

“The people were walking behind him, ‘I said guys please stay far from him, this guy is going to do something.’ People think I am crazy,” Tahhan told a crowd of reporters, shortly after the arrest. “I said to the police, ‘This is the guy, he did the problem in Brooklyn.’ Thank God we catch him.”

Police said James shot ten people before his gun jammed and left riders scrambling from the subway car. About 20 others were injured in the frantic rush, officials said, though none of the injuries are considered life-threatening.

At least 30 victims were treated at four local hospitals following the attack, and all but seven had been released as of Wednesday afternoon, according to officials with each facility.

The rampage came as New York City is grappling with an increase in gun violence, along with several high profile incidents in the subway system that have left many riders wary of returning underground.

Police officials have yet to identify a motive in connection with the shooting. But a YouTube account that police have linked to James includes hundreds of disturbing videos detailing a litany of personal grievances and violent fantasies.

In hours of monologues, the man who appears to be James describes his desire to “watch people die,” his hatred of other Black people, and his “emotionally violent” experience inside New York City’s mental health system. At other points, he praises the September 11th terrorist attacks and questions why Mayor Eric Adams isn’t doing more to address homelessness on the subway.

Officials said James had addresses in Wisconsin and Pennsylvania, as well as connections to New York and New Jersey. In his YouTube videos, he referenced several experiences at local psychiatric facilities, railing against the employees of those institutions as “enemies.”

According to a Facebook post, James attended Argus Community, a South Bronx school for “severely disadvantaged teens.”

Dwayne Waters, who identified himself as the suspect’s cousin, told Gothamist that James was raised by his dad in the South Bronx, along with five sisters.

Waters described his cousin as a “really good guy” who loved fishing and go-carts, but began exhibiting signs of mental illness in his late teens. He lost contact with James more than two decades ago, but said concerned family members kept an eye on his erratic social media behavior, where James frequently posted anti-Black and misogynistic tirades.

“He rants and raves on social media, talking out of his mind,” Waters said. “I really didn’t want anything to do with him.”

He added that family members were horrified to see James connected to the subway shooting, and extended their sympathy to the victims. “I’m very sorry for the pain they have to go through because of someone I know,” Waters said.

In the most recent YouTube video, published this past Monday, James reiterates his desire to hurt other people, but says that he has “absorbed” his pain out of a fear of going to prison.

“We live in a violent society, where people are pushed to the edge of their f--king sanity by other motherf--kers,” James said in one video. “I can almost understand how a motherf--ker could go out here and just start shooting people for no f--king reason.”

New York Gov. Kathy Hochul appeared to learn of the arrest when a staff member passed her a note at the rostrum during an anti-hate rally in Queens.

"Breaking news," Hochul said. "There are reports that the suspect has been arrested."

The crowd broke into applause.

Jon Campbell contributed reporting. This is a developing story and will be updated.

Correction: A previous version of this story misspelled Zack Tahhan's name.