A court has ruled that a Pakistani citizen should be expelled from Romania on charges of promoting "extremist Islamism" online, causing a threat to national security.

The Court of Appeal ruled Tuesday that the man, identified only by his initials S.A., should be expelled for 10 years.

Romania's main domestic intelligence agency said in a statement Tuesday that the man entered Romania illegally in 2015 and then married a Romanian woman. It said he sought to obtain a residency permit based on his marriage.

The agency said it kept him under surveillance and found he was engaged in spreading propaganda online for Pakistani "terrorists."

The statement said he supported the "supremacy of extremist Islam" and "global jihad," and was interested in making improvised explosive devices.