Norway arrested an American white nationalist before he gave a speech at a far-right conference in Oslo over the weekend, Norwegian officials told NBC News on Monday.

Greg Johnson was scheduled to speak Saturday at the Scandza Forum in the country’s capital, a far-right event promoted by Counter-Currents Publishing, a white nationalist organization in which he serves as an editor in chief.

Martin Bernsen, a senior adviser and spokesman for Norway’s domestic security agency PST, said Johnson was detained under a section of the country’s Immigration Act.

He called Johnson’s arrest a “preventative measure.”

“We wanted him out of the country as soon as possible,” Bernsen said, adding that the American also has residency in Hungary.

He added that Johnson was arrested to “prevent him from encouraging right-wing groups and individuals in Norway” and “stop him from contributing to new recruitment” in the country.

According to the Southern Poverty Law Center, Counter-Currents is "the flag-bearer of what Johnson calls the 'North American New Right,' a concept whose main objective is to legitimize the idea of a white ethnostate."

Bernsen said no other far-right representatives have been arrested alongside Johnson. He declined to comment when asked why only Johnson was detained.

He said Johnson is not facing any formal charges, but the immigration act was used by Norwegian authorities to remove him from the country.

Johnsons’ Oslo-based lawyer, John Christian Elden, told NBC News in a WhatsApp message that Johnson has left the country Monday and is on his way to Lisbon, Portugal, for a rally.

Elden said Johnson was detained in Norway as a “threat to national security” ahead of the conference, but will not face any legal action.

Counter-Currents Publishing also referenced a statement from Johnson made before his arrest, in which he said that he has “always consistently condemned violence and terrorism.”

“I have never supported Breivik’s crimes,” he said in the statement, referring to Norwegian mass murderer and right-wing extremist Anders Breivik, who killed 77 people in a bomb and shooting rampage in 2011.

Johnson penned an essay on Breivik in 2012, describing him as “creepy, narcissistic dork,” but also talking about “a strange new respect for him.”

Norway experienced far-right extremism earlier this year. In August, a man stormed an Oslo mosque with a gun, but was overpowered by members of the congregation. Norwegian authorities said he had expressed far-right, anti-immigrant views online.