FBI agents on Thursday arrested a former Canadian armed forces reservist and two other men linked to a violent white-supremacist group, who were believed to be heading to a pro-gun rally next week in Virginia’s capital.

The three men, one of whom was affiliated with the U.S. military, were members of The Base and were arrested on federal charges in a criminal complaint unsealed in Maryland, according to a Justice Department news release.

The complaint charged Canadian national Patrik Jordan Mathews, 27, and Brian Mark Lemley Jr., 33, of Elkton, Md., with transporting a firearm and ammunition with intent to commit a felony. William Garfield Bilbrough IV, 19, of Denton, Md., was charged with “transporting and harboring aliens.”

All three men made their initial court appearances Thursday afternoon in Greenbelt, Maryland.

The men are expected to remain in custody until their arraignment next Wednesday.

Bilbrough’s defense argued that he was charged with relatively minor crimes and didn’t even have a passport, and therefore should have been released pending the next hearing.

The government said Bilbrough had expressed an interest to travel to Ukraine to fight alongside Ukrainian nationalists.

The three men were believed to be planning to attend the pro-gun rally planned for Monday in Richmond, according to a law enforcement official who spoke to The Associated Press on condition of anonymity to discuss an active investigation.

In encrypted chat rooms, members of The Base have discussed committing acts of violence against blacks and Jews, ways to make improvised explosive devices, their military-style training camps and their desire to create a white “ethnostate,” according to an FBI agent’s affidavit.

Mathews and Lemley were arrested in Delaware and Bilbrough was arrested in Maryland, according to Marcia Murphy, a spokeswoman for the U.S. Attorney’s office in Maryland.

Court papers showed that Mathews illegally crossed the U.S. border near Minnesota in August and investigators alleged that Lemley and Bilbrough then drove from Maryland to Michigan to pick up Mathews before the three headed to Maryland in late August.

Mathews was a combat engineer in the Canadian Army Reserve.

Lemley was a “cavalry scout” in the U.S. Army, according to a court filing.

U.S. and Canadian law enforcement had been searching for Mathews after his truck was found in September near the border between the two countries. He was last seen by family members in Beausejour, northeast of Winnipeg, on Aug. 24, according to the Royal Canadian Mounted Police. The Canadian military’s intelligence unit was investigating Mathews for “possible racist extremist activities” for several months, according to the Canadian Department of National Defence.

Investigators said Lemley and Mathews built an assault rifle using several parts, including an upper-receiver that Lemley had ordered and shipped to a Maryland home. In December, the three men gathered at an apartment that Lemley and Mathews rented in Delaware, where they discussed The Base and its activities and members, passed around the assault file and tried to make the drug DMT, a hallucinogen, according to court papers.

A few days later, Lemley and Mathews bought 150 rounds of ammunition and paper shooting targets and an FBI agent spotted Lemley at a gun range in Maryland. Court papers showed that federal agents heard the gun firing in rapid succession and investigators said Lemley later told Mathews: “Oh, oops, it looks like I accidentally made a machine gun.”

Federal agents appeared to have tracked the men’s movements and set up a stationary camera near the gun range, which captured video of Mathews shooting the gun there on Jan. 5. Court documents showed that Lemley also had ordered 1,500 rounds of ammunition and he and Mathews visited the gun range as recently as Saturday.

Lemley also was charged with transporting a machine gun and “disposing of a firearm and ammunition to an alien unlawfully present in the United States.”

The Anti-Defamation League said members of The Base and other white-supremacist groups frequently have posted online messages advocating for “accelerationism,” a fringe philosophy in which far-right extremists “have assigned to their desire to hasten the collapse of society as we know it.”

“The term is widely used by those on the fringes of the movement, who employ it openly and enthusiastically on mainstream platforms, as well as in the shadows of private, encrypted chat rooms,” the ADL said.

The Counter Extremism Project (CEP), a nonprofit, nonpartisan organization that tracks extremist groups, as Reuters reported, said The Base, fighting to impose order from chaos, seeks to train members to fight a race war, and draws inspiration from the book “Siege,” by the neo-Nazi James Mason.

The Base’s members portray themselves as vigilante soldiers defending the “European race” from a broken “system” infected by Jewish values, according to the ADL.

The Base was launched in 2018.

Gov. Ralph Northam, D-Va., declared a state of emergency Wednesday in anticipation of the gun rally next week.

CLICK HERE FOR THE FOX NEWS APP

He tweeted: “We have received credible intelligence from our law enforcement agencies of threats of violence surrounding the demonstration planned for Monday, January 20. This includes extremist rhetoric similar to what has been seen before major incidents, such as Charlottesville in 2017. This intelligence suggests militia groups and hate groups, some from out of state, plan to come to the Capitol to disrupt our democratic process with acts of violence. Based on these threats, I am declaring a state of emergency in Richmond from Friday evening until Tuesday evening. This will include a ban on weapons of any kind in Capitol Square during that time.”

Fox News’ Jake Gibson and The Associated Press contributed to this report.