When Mr. James was taken into custody, more details emerged about a life with numerous arrests.
According to public records, he was born in New York City in 1959, and his sister, Catherine James Robinson, said he often moved between cities.
Police officials said he was arrested nine times in New York City between 1992 and 1998, on a number of charges, including possession of burglary tools, criminal sex acts and criminal tampering. He was arrested three times in New Jersey, the first in 1991, the most recent in 2007.
In completing a portrait of Mr. James, detectives focused on dozens of videos he claimed to have posted on YouTube in which he delivered bigoted diatribes related to current events.
In some, he commented on the New York City subway, criticizing Mr. Adams’ policy of tackling homelessness on public transit as ineffective and speculating that the mayor couldn’t possibly stop all the crime in the system. In others he mused on violent acts and vaguely hinted at the possibility of committing them.
In the coat that Mr. James had discarded on the 36th Street subway platform, investigators found a receipt from a storage facility in Philadelphia, where he rented an apartment for about two weeks beginning in late March, according to the federal indictment.
When they searched the storage room and his apartment on Tuesday and Wednesday, they found handgun ammunition, a taser, a high-capacity rifle magazine and a smoke canister, the indictment said.
Reporting contributed by Jonah E. Bromwich† Troy Closson† Michael LaForgia† Ana Ley† Chelsea Rose Marcius† Andy Newman† Rebecca Davis O’Brien† Sean Piccoli† Michael Rothfeld† Nate Schweber† Ashley Southall† Ashley Wong and Karen Zraick†