A Northern Virginia man arrested this week on gun charges is a neo-Nazi who has bragged about committing racially motivated violence, authorities said Friday.

At a detention hearing in U.S. District Court in Alexandria, FBI agent Shawn Matthews testified that Andrew Thomasberg, 21, joined Atomwaffen, a group that advocates racial holy war, after attending the 2017 white supremacist rally in Charlottesville. He had previously been a member of Vanguard America, a somewhat less radical white nationalist group, Matthews said.

The agent said Thomasberg bragged in text messages about committing a racially motivated shooting in the past and using racial epithets against a group of African Americans he saw at a shopping mall. He said he would have gone "St. Roof" on them if they had stopped to confront him. That's a laudatory reference to Dylann Roof, who shot and killed black churchgoers in South Carolina in 2015, according to Matthews, who investigates domestic terrorism for the bureau.

A judge ordered Thomasberg detained while he awaits trial on weapons charges.

Thomasberg's lawyer declined comment. Thomasberg's mother attended the hearing and said afterward that the FBI is targeting him because he's a "rich white kid."

Asked if her son is a neo-Nazi, she said, "No. He's Greek Orthodox."

Thomasberg did not speak during the detention hearing. He shrugged with his palms up toward his family after the judge ordered him detained and marshals escorted him out of the courtroom.

The charges against Thomasberg relate to his possession of weapons. Thomasberg's case is one of several recently in which federal prosecutors have brought weapons charges against people with links to neo-Nazis and white supremacist groups.

Prosecutors say Thomasberg illegally possessed the weapons as an abuser of controlled substances and that he illegally obtained one by serving as a straw purchaser. During an arrest and search of the man's home Thursday, Matthews said, agents found 20 guns in the home he shares with his mother and stepfather, including six in his room. A loaded handgun was found in the glove compartment of his car, Matthews added. Family members said some of the guns were theirs, not his.

In text messages, prosecutors say, he laments that an April synagogue shooting in San Diego in which one person was killed "Coulda been so good" and refers to Pittsburgh synagogue shooter Robert Bowers and New Zealand mosque shooter Brenton Tarrant as saints.

Matthews said Thomasberg's membership in neo-Nazi groups changed from Vanguard America to Atomwaffen after the 2017 Charlottesville rally. Atomwaffen Division is a neo-Nazi group that has been linked to several killings, including the May 2017 shooting deaths of two men at an apartment in Tampa, Florida.

Vanguard America is one of the far-right extremist groups that had members participate in the white nationalist rally that erupted in violence in Charlottesville, Virginia, in August 2017. On the eve of the rally, the white nationalist group's members also joined a torchlit march through the University of Virginia's campus, chanting "Blood and soil!" and "Jews will not replace us!"

James Fields Jr. was photographed holding a shield bearing a Vanguard America emblem before he rammed his car into a crowd of counterprotesters, killing 32-year-old Heather Heyer. The white nationalist group denied any association with Fields, who was sentenced to life in prison for Heyer's death.