U.S. District Judge Edward Chen issued an injunction against the Trump administration’s plan to wind down temporary protected status for 300,000 foreigners living in the U.S.

Chen questioned whether the government’s TPS cancellations had been made on the basis of racial prejudice against the TPS beneficiaries from El Salvador, Haiti, Nicaragua and Sudan.

The preliminary injunction orders the government to maintain TPS protections while a lawsuit challenging the cancellations is concluded.

A federal judge in California blocked the government’s plan late Wednesday to wind down a humanitarian program for hundreds of thousands of foreign nationals living in the U.S., citing concerns the decision was motivated by racial animus on the part of President Donald Trump.

U.S. District Judge Edward Chen issued a preliminary injunction that prevents the Department of Homeland Security (DHS) from canceling Temporary Protected Status (TPS) for roughly 300,000 migrants from Haiti, El Salvador, Nicaragua and Sudan.

In a 43-page ruling, Chen ordered the government to continue granting TPS protections and work permits to qualifying foreign nationals while a lawsuit challenging the TPS decision makes its way through the courts. (RELATED: Federal Judge Gives Green Light To Lawsuit Against Trump’s ‘Racist’ Cancellation Of TPS)

Chen questioned whether DHS, which ordered the TPS cancellations, had been pressured to end the program by the White House. Specifically, he said certain racially charged remarks by Trump suggested the decision was made on the basis of prejudice against “non-white, non-European immigrants,” not conditions on the ground in the affected countries.

“There is also evidence that this may have been done in order to implement and justify a pre-ordained result desired by the White House,” Chen, an Obama appointee, wrote in his order. “Plaintiffs have also raised serious questions whether the actions taken by the Acting Secretary or Secretary was influenced by the White House and based on animus against non-white, non-European immigrants in violation of Equal Protection guaranteed by the Constitution.”

“The issues are at least serious enough to preserve the status quo,” he added.

TPS is a humanitarian relief program that offers a temporary reprieve from deportation and work permits to foreign nationals of countries affected by war, natural disaster or some other extraordinary crisis. Though it is not intended to be a permanent solution, TPS has in some cases turned into a de facto immigration program for people from countries that have held the designation for decades. (RELATED: This Is How ‘Temporary’ Protected Status Became Permanent For 300,000 People)

TPS protections must be renewed periodically, and previous administrations had granted many extensions automatically. But the Trump administration took a harder line, arguing that TPS extensions were unrelated to the original humanitarian disaster and did not reflect current conditions on the ground.

In January, the administration rescinded TPS for El Salvador, which was given the designation in 2001 after a series of destructive earthquakes. Roughly 200,000 Salvadoran nationals living in the U.S. with TPS have until September 2019 to return to their home country unless they are eligible for another immigration benefit.

Before that, the government made a similar determination for Haiti, which was granted TPS in 2010 in response to a massive earthquake that destroyed much of the country. About 59,000 Haitians have until July 2019 to leave the U.S. or adjust their immigration status.

Sudan and Nicaragua will lose TPS designation in November and January 2019, respectively.

In a statement criticizing Chen’s ruling, Department of Justice (DOJ) spokesman Devin O’Malley denied the Trump administration’s decisions on TPS were racially motivated.

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

As in other court decisions against the administration’s immigration policies, Chen’s order cited controversial comments Trump made during the campaign and while in office. It referred to Trump’s remarks “characterizing Mexican immigrants as drug dealers or users, criminals and rapists” and his alleged comments during a meeting at the White House in January, when he allegedly called TPS countries, “shithole countries.”

Chen also concluded that many TPS beneficiaries and their children have been living in the U.S. for so long that it would be unduly cruel to force them to go back to their home countries.

“The balance of hardships thus tips sharply in favor of TPS beneficiaries and their families,” he wrote.

Follow Will on Twitter

Send tips to will@dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.