A federal judge on Friday ruled that laws that US President Donald Trump’s administration used to cancel visas and initiate deportation proceedings against noncitizen college students based on their pro-Palestinian advocacy and criticism of Israel are unconstitutional.

US District Judge Noel Wise in San Jose, California in a blistering ruling chastised the US State Department and US Department of Homeland Security for how they had deployed provisions of federal immigration law to target non-citizens for deportation for expressing views they wanted to suppress.

The judge, an appointee of former president Joe Biden, said that in the United States, free speech, including the freedom to criticize the government and its leaders, was evidence of the strength of the country’s democracy.

“That strength is diminished when members of our society — citizens and noncitizens alike — must self-censor and ‘behave’ or suffer the government’s retaliation,” she said.

The State Department and DHS did not immediately respond to requests for comment.