Oct. 4 (UPI) — A federal judge in California temporarily blocked the Trump Administration’s decision to end Temporary Protected Status for immigrants from four countries.

Judge Edward Chen of the Northern District of California placed a preliminary injunction on the effort to end TPS for immigrants from El Salvador, Haiti, Sudan and Nicaragua on grounds that it would cause severe hardship for those people and because the administration might have violated the Equal Opportunity Clause of the Constitution by showing an “animus against non-white, non-European immigrants.”

Department of Justice spokesman Devin O’Malley blasted Chen’s decision in a statement Wednesday night.

“The Court’s decision usurps the role of the executive branch in our constitutional order,” O’Malley said.

“The Court contends that the duly elected President of the United States cannot be involved in matters deciding the safety and security of our nation’s citizens or in the enforcement of our immigration laws.”

O’Malley added: “The Justice Department completely rejects the notion that the White House or the Department of Homeland Security did anything improper. We will continue to fight for the integrity of our immigration laws and our national security.”

The preliminary injunction will offer temporary relief to approximately 240,000 people who are facing deportation within the next few months due to the administration’s decision to end their TPS status.

TPS status for Sudanese recipients was scheduled to end at the end of November.

However, the injunction is only temporary and another hearing id scheduled for Oct. 24.

TPS was granted to those immigrants because of dire conditions in their countries — including natural disasters and civil war — at various times within the last 20 years and has typically been renewed every few years by the U.S. Citizenship and Immigration Services and the Department of Homeland Security/

But the Trump administration stopped that trend by saying the immigration status is only meant to be temporary, as its name indicates, and conditions in those countries have improved since TPS status was given.

In some cases, such as Nicaragua, TPS recipients immigrants have been living legally in the United States since 1999, when a hurricane ravaged the country. The DHS says damage from that hurricane is no longer a factor in Nicaragua and TPS was no longer necessary. And those who have not since filed for legal residency since coming to the United States faced deportation.

But critics of the Trump administration’s decision say it’s cruel to deport people who have been legal immigrants and built lives in the United States over many years.

“Judge Chen’s ruling vindicates the brave struggle of TPS holders to defend the Constitution in the face of the Trump administration’s discriminatory attack on this humanitarian program on which so many hundreds of thousands of people rely,” Emi MacLean of the National Day Laborer Organizing Network said, according to CNN.