A federal judge in California temporarily blocked the Trump administration's plans to terminate the legal status of more than 300,000 immigrants who fled violence and disaster in Haiti, Sudan, Nicaragua and El Salvador.

In a decision late Wednesday, U.S. District Judge Edward Chen in San Francisco found substantial evidence that the administration lacked "any explanation or justification" to end the "temporary protected status" designations for immigrants from those countries.

At the same time, he said there were "serious questions as to whether a discriminatory purpose was a motivating factor" in the administration's decision, which would violate the Constitution's guarantee of equal protection under the law.

He cited statements by President Donald Trump denigrating Mexicans, Muslims, Haitians and Africans, including his Jan. 11 remark about "people from shithole countries."

It is one of numerous cases in which such racial or ethnic comments by the president have been cited by judges to block administration immigration policies.

The judge did not rule on the merits of the case, but rather issued a preliminary injunction so the merits could be considered. The potential harm to the immigrants - return to their countries of origin after spending years in the United States - outweighed any harm to the government, he said.

"Absent injunctive relief, TPS beneficiaries and their children indisputably will suffer irreparable harm and great hardship," Chen wrote. "TPS beneficiaries who have lived, worked, and raised families in the United States (many for more than a decade), will be subject to removal. Many have U.S.-born children; those may be faced with the Hobson's choice of bringing their children with them (and tearing them away from the only country and community they have known) or splitting their families apart."

Justice Department spokesman Devin O'Malley in a statement shortly after the decision said the administration would "continue to fight for the integrity of our immigration laws and our national security." He said Chen's decision "usurps the role of the executive branch in our constitutional order," and rejected "the notion that the White House or the Department of Homeland Security did anything improper."

The ACLU of Northern and Southern California, National Day Laborer Organizing Network and private law firm Sidley Austin filed the lawsuit in March on behalf of TPS beneficiaries who would face deportation as a result of the Trump administration's actions.

In a series of announcements in the fall of 2017 and early 2018, DHS said it planned to terminate the temporary protected status of the immigrants from Haiti, Sudan, Nicaragua and El Salvador, claiming the life-threatening conditions that caused the immigrants to flee no longer existed.

But Chen found that the plaintiffs presented a "substantial record" showing that DHS's decision to changed various criteria affecting the TPS program "without any explanation or justification," in violation of the Administrative Procedure Act.

First published by The Washington Post.