BRUSSELS — Belgium’s Parliament has quietly passed legislation giving the government extraordinary powers to deport legal residents on the mere suspicion of engagement in terrorist activities, or for “presenting a risk” to public order or national security, without a criminal conviction or the involvement of a judge.

The law applies only to foreign residents, not to Belgian nationals or refugees, part of a toughening of domestic security laws that has begun to worry human rights groups and ordinary citizens as a threat to civil liberties. Besides counterterrorism concerns, supporters of this law have been motivated by anti-immigrant sentiments, which they feel are widely shared not only in their country but across the European Union and even in the United States.

Amid fears of terrorism, some other European countries have also introduced stricter immigration policies, and Hungary, Austria and the Netherlands have lowered their threshold for deportation in recent years.

But the Belgian legislation stands out for its vague language, which grants unprecedented powers to the government to interpret and enforce the law as it sees fit, critics said.