Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An armed Missouri man arrested for pulling the emergency brake on an Amtrak train in rural western Nebraska is allegedly a white supremacist who now faces a terrorism charge, according to newly unsealed court papers.

Taylor Michael Wilson, 26, belongs to a neo-Nazi group, traveled to Charlottesville for alt-right rallies, and talked about "killing black people," his cousin told FBI agents, according to the affidavit filed in federal court.

Authorities found an arsenal in a secret compartment behind his refrigerator, and white supremacy images and how-to guides to killing on his phone, the affidavit says.

Taylor Wilson is accused of pulling an emergency brake to stop an Amtrak train in south-central Nebraska. via Lincoln Journal Star

Wilson — who has a history of mental health problems and drug use, according to officials — was arrested in October in Nebraska after he allegedly barged into a secure area of an Amtrak train and employed the emergency brake, forcing the train to lurch to a stop.

"The facts set forth in the complaint affidavit indicate that defendant had great potential and the inclination to cause great harm to persons on the train and perhaps others in a nearby community if the train had actually wrecked," a magistrate wrote in a detention order this week.

The public defender who represented Wilson at a detention hearing did not respond to requests for comment, and Wilson's parents did not return a call. The Southern Poverty Law Center said Wilson was not in its database of members of hate groups.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

According to witnesses on the train, Wilson seemed half-crazed, making bizarre statements like, "I'm the conductor, bitch" and "What are you going to do, shoot me?"

Related: Charlottesville City Council Meeting Erupts Over White Nationalist Rally

They restrained him for police, who found a loaded .38 caliber handgun in his waistband, an ammunition cartridge in his pocket and more ammunition, a knife, a hammer and a respirator mask in his backpack. They also found a business card for the National Socialist Movement, which civil rights groups say is a neo-Nazi organization.

Local authorities charged Wilson with criminal mischief and weapons possession. He was found competent after a court-ordered psychiatric exam and released on $100,000 bond secured by $10,000 cash.

Tom Patterson, the Furnas County attorney, told NBC News the state probably would have added more serious charges if the feds had not taken over the case. The state charges will stand until the federal case runs its course, he said.

Taylor Michael Wilson, 26, barged into a secure area and activated the emergency brake on an Amtrak train in October. Joe Raedle / Getty Images file

The FBI was brought into the investigation early on and the terrorism complaint was filed in December. Wilson was ordered held without bail during a Dec. 28 detention hearing.

The complaint, unsealed this week, reveals that Wilson was the suspect in a 2016 road rage incident in Missouri in which a black woman reported a white man pointed a gun at her for no apparent reason. By the time Wilson was located, the victim couldn't be found, so he was not charged, the FBI affidavit says.

In the fall of 2017, he accompanied his cousin to Sacramento, the complaint says. He was on his way back when the incident on the train occurred.

Wilson's parents told investigators they didn't know where in St. Charles, Missouri, he lived with his cousin — although it later turned out the apartment was in a building they own. They also said he had "several" legally purchased firearms, but eventually turned over 15 weapons, including an illegal fully automatic rifle and another illegally converted rifle, court documents say.

Related: White Nationalists Warn They Will Return to Charlottesville

The cousin told investigators that Wilson had been acting strangely since the summer and had "joined an 'alt right' Neo-Nazi group that he had found researching white supremacy forums on-line," the affidavit said.

Wilson "traveled with members of the 'alt-right' Neo Nazi group to the protests in Charlottesville, Virginia," the cousin told investigators. The cousin said Wilson "has expressed an interest in 'killing black people' and others besides whites, especially during the protests in St. Louis," the affidavit said. The cousin also believed Wilson had posted "Whites Only" signs on businesses.

It was the cousin who led investigators to the secret storage area. Inside, they found a tactical vest, 11 AR-15 rifle magazines and other accessories, hundreds of rounds of ammunition, a pressure plate that can be used to make a bomb, gunpowder and white supremacy documents.

Patterson, the county attorney, said it was a stunning outcome.

"We are a small county," he said. "These things aren't supposed to happen here.'