(CNN) Hundreds of thousands of immigrants who feared they could soon be facing deportation got a reprieve Wednesday, when a federal judge in California temporarily blocked one of the Trump administration's major immigration moves.

US District Judge Edward Chen granted a preliminary injunction stopping the government from terminating temporary protected status, or TPS, for immigrants from Sudan, El Salvador, Haiti and Nicaragua.

Chen ruled that the government must maintain TPS, and employment authorizations for TPS beneficiaries from those countries, while a lawsuit challenging the government's decision to eliminate their protections continues.

TPS protects migrants in the United States from countries that have been hit by dire conditions, such as epidemics, war or natural disaster. Previous administrations had opted to extend the protections for most of the countries involved every few years when they came up for review, but the Trump administration has moved toward ending protections for the majority of immigrants under the program, arguing that the initial conditions that necessitated them are no longer present.

The judge's decision comes a week after a hearing in the case. It goes into effect immediately and is particularly welcome news for TPS recipients from Sudan, who were less than a month away from losing their protections.

Read More