GREENBELT, Md. (Reuters) – Three suspected members of a neo-Nazi group appeared in a Maryland court on Thursday to face federal charges after the FBI arrested them for carrying an assault rifle and planning to incite violence at a gun-rights rally in Virginia.

Earlier on Thursday, the FBI arrested the trio: Brian Lemley, 33, a former cavalry scout in the U.S. Army; Patrik Mathews, 27, a combat engineer in the Canadian Army Reserve who authorities said had illegally entered the United States; and William Bilbrough, a teenager who prosecutors called a serious flight risk, saying he expressed a desire to fight with Ukrainian nationalists.

Their appearance in the U.S. District Court in Greenbelt, Maryland, came the day after Virginia Governor Ralph Northam declared a state of emergency banning any weapons around the grounds of the state capitol in Richmond.

He said investigators had seen groups making threats of violence ahead of the gun-rights rally planned at the legislative building for Monday.

Federal prosecutors said the three suspects were members of the neo-Nazi group The Base, a small militant organization dedicated to committing violence against minorities and obstructing authorities from learning about their activities. When Lemley and Mathews were arrested, they smashed their cellphones and dumped them into the toilet before submitting to federal agents, Assistant U.S. Attorney Thomas Windom said.

Standing calmly before Judge Charles Day, Lemley wore a T-shirt and pajama pants, while Mathews sported camouflage pants and a bushy blond beard.

Both men answered “yes” when the judge asked if they understood the charges against them, which include transporting a firearm with intent to commit an offense. They answered “no” when asked if they were under the influence of drugs or alcohol.

Bilbrough, redheaded and wearing glasses, listened as prosecutors read the charges against him, including transporting and harboring aliens. He smiled several times as prosecutors described his alleged activity with the Base.

Lemley and Mathews remained in federal custody due to their alleged firearms violations. The judge decided to detain Bilbrough after prosecutors said the 19-year-old defendant might go into hiding or try to flee the country since he had repeatedly expressed a desire to travel to Ukraine to fight with “nationalists” there.

Bilbrough's defense attorney denied that his client posed a flight risk, noting that he lived with his grandmother and lacked a passport.

The judge set the three defendants' detention hearings for Wednesday.

The FBI and the Department of Homeland Security have been sharply criticized for not focusing enough on the threat of far-right extremism following a spate of attacks on synagogues and a 2017 white-supremacist rally in Charlottesville, Virginia. Heads of both of those agencies have said in recent months that they were taking the threat more seriously.

Several thousand gun rights supporters are planning a large rally in Richmond, Virginia's capital, on Monday in response to the newly Democratic-controlled state legislature's push to stiffen gun laws.

Virginia, where Democrats took control of the legislature by promising stronger gun laws, has become the latest focal point for the contentious American debate around the right to bear arms. Many gun-rights groups contend the U.S. Constitution guarantees their ability to possess any firearm. Those opposed say gun laws would help lessen the number of people killed by guns each year.

The three men are accused of interstate commerce of weapons, harboring illegal aliens, an alien in possession of a firearm and ammunition, and aiding and abetting. The FBI also said in the court filing that the men had attempted to manufacture DMT, a powerful psychedelic that is an illegal drug under federal law.

While federal authorities can bring criminal terrorism charges against those suspected of working on behalf of foreign extremist groups like al Qaeda, they lack those tools when pursuing affiliates of domestic extremist groups, whose views are protected by the free-speech clause of the U.S. Constitution.

The men were in possession of what looked like a fully automatic rifle, according to an FBI agent who watched the men fire the weapon at a gun range.

Shortly after firing the weapon on Jan. 2 at a Maryland gun range, Lemley told Mathews, “Oh, oops, it looks like I accidentally made a machine gun,” according to the court document.

Lemley and Mathews lived together in Delaware, while Bilbrough resided in Maryland. Mathews illegally crossed over the border into the United States in August, the court document said.

(Reporting by Julia Harte in Greenbelt, Maryland, Brad Brooks in Austin, Texas, Mark Hosenball and Andy Sullivan in Washington and Gabriella Borter in New York; Editing by Scott Malone, Jonathan Oatis and Tom Brown)