Frank James, 62, was arrested by patrol officers in New York’s East Village on Wednesday, NYPD Commissioner Keechant Sewell said.

The New York Police Department said James was the suspect behind a mass shooting on Tuesday that left 10 shot and 19 others injured in Brooklyn. Police believe none of the injured had life-threatening injuries.

He is charged with violating a law that prohibits terrorist attacks and other violent attacks on a public transportation system, according to Breon Peace, U.S. Attorney for the Eastern District of New York. The motive for the shooting is still unknown.

James was linked to rambling videos posted on a YouTube channel that has since been deleted. A screenshot from one of the videos was used on an NYPD Crime Stoppers flyer seeking information about the shooting. In one video, he posts a New York City ID card from a former teacher training program.

The suspect was known to authorities

James was known to New York authorities before Tuesday’s attack. He had nine prior arrests in the city dating from 1992 to 1998 for offenses including possession of burglary tools, a criminal sex act and theft of service, NYPD Chief of Detectives James Essig said during a Wednesday press conference.

He was also arrested three times in New Jersey, in 1991, 1992 and 2007 for trespassing, theft and disorderly conduct, Essig said.

However, James had no previous felony convictions and was therefore able to purchase a gun, according to Essig.

Videos include racist and misogynistic language

Many of the videos James uploaded to a YouTube channel included references to violence, including a defined group of people he believed had slandered him, in addition to broad societal and racial groups it seemed. to hate.

A YouTube spokesperson confirmed on Wednesday that the channel has been removed in accordance with its “creator accountability guidelines” and that the platform “highlights videos from authoritative sources in research and recommendations.”

CNN was able to analyze the videos posted by the account before they were removed.

In what appears to be his final video posted on Monday, James talks about someone who engaged in violence and ended up in jail. He said he could identify but spoke of the aftermath.

“I’ve been through a lot of bullshit, where I can say I wanted to kill people. I wanted to see people die right in front of my fucking face immediately. But I thought about, Hey man, I don’t want to go to a fucking prison.”

James and his family did not immediately respond to CNN’s request for comment.

In a video uploaded in February, James criticized a plan by New York City Mayor Eric Adams’ administration to tackle subway safety and homelessness in part through an increased presence of security professionals. mental health.

In the racist and rambling recording, James said the new effort was ‘doomed’ and described his own negative experience with city health workers during a ’90s mental health crisis. , 80 and 70″.

In a video posted last week, James, who is black, speaks out against abuse in churches and racism in the workplace, using misogynistic and racist language.

After talking about communal violence, James said, “We need to see more mass shootings. Yeah. … We need to see more, there needs to be more mass shootings to make an***er understand. … It’s not about the shooter, it’s about the environment it’s in, it has to exist.”

This speech was a common theme in James’ videos, in which he repeatedly espoused hatred towards African Americans.

What we know about the Brooklyn subway shooting

In another video posted last month on the same channel, James said he was suffering from post-traumatic stress. In this video, James said he left his home in Milwaukee on March 20. On the eastward journey, he said he was heading into the “danger zone”.

“You know, of course it triggers a lot of negative thoughts,” he said in the video. “I have a severe case of post-traumatic stress.”

Preliminary information indicated that James had mentioned homelessness, New York City and its mayor in online posts, NYPD Commissioner Keechant Sewell said Tuesday. As a result, she said the city would increase security for the mayor.

Police released two photos of James at a press conference on Tuesday evening, including one that appeared to be a screenshot from a YouTube video.

Keys belonging to a U-Haul that had been rented under James’s name in Philadelphia were found among the gunman’s possessions at the scene of the shooting in Brooklyn, the NYPD said.

The videos provide insight into James’ path to the Northeast. He arrived in Philadelphia on March 25 after stops in Fort Wayne, Indiana; Pittsburgh; and Newark, New Jersey.

CNN’s Shimon Prokupecz, Brynn Gingras and Kristina Sgueglia, and Elizabeth Wolfe contributed to this report.