BURLINGTON, Vermont — A federal judge on Wednesday ordered the immediate release of a Columbia University student who was detained by immigration authorities and targeted for deportation over his involvement in pro-Palestinian protests.

Mohsen Mahdawi was arrested as part of a crackdown on foreign students who were legally studying in the United States. Secretary of State Marco Rubio has invoked a rarely used provision of immigration law to target some of the students for deportation by declaring that their continued presence in the country harms America’s foreign policy interests.