President Donald Trump tries to take an executive action clearly within his constitutional authority and runs into opposition from liberal judges in the federal courts based on the chief executive’s rhetoric.

It sounds a lot like the travel ban, which the Supreme Court in June resolved in the president’s favor.

But on Wednesday, a federal judge cited the president’s alleged “animus against nonwhite, non-European immigrants” in temporarily blocking the administration from ending a program granting legal residency to hundreds of thousands of people whose countries suffered natural or man-made disasters years ago.

The program is known as Temporary Protected Status (TPS), which is intended to allow people to stay in the United States while their home countries recover. It applies to foreigners who came legally and illegally to the United States. And although the word “temporary” is in the name of the program, past administrations have routinely renewed TPS status year after year.

The ruling affects roughly 300,000 people from El Salvador, Nicaragua, Haiti and Sudan. The Department of Homeland Security (DHS) has made separate determinations over the past two years that the conditions that prompted the TPS designation had passed and gave beneficiaries 18 months to make preparations to return home.

The oldest of those designations dates to 1997 for residents of Sudan, granted relief as a result of civil war in the African nation. But that war ended in 2005, and a political compromise led to the creation of the new nation of South Sudan in 2011.

U.S. District Judge Edward Chen, an appointee of President Barack Obama, noted in his ruling that TPS beneficiaries have bought houses, raised families and built careers during the ensuing years.

“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,” the judge wrote.

Related: Refugee Program Costs $125 Billion Over 10 Years, Feds Say

Critics of open-ended TPS noted the perversity of a situation in which endless extensions of the program create the rationale for never ending it.

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

“It is a circular argument,” said Jessica Vaughan, director of policy studies at the Center for Immigration Studies (CIS), a Washington think tank that favors lower levels of immigration.

Vaughan told LifeZette that the federal government never has said how many TPS recipients were illegal immigrants when they first received the benefit, but she added that it almost certainly is a majority.

Chen’s ruling is not the final word. It freezes the status quo at least until a hearing on October 26.

The Department of Justice vowed to continue defending the decision.

“The court’s decision usurps the role of the executive branch in our constitutional order,” spokesman Devin O’Malley said in a statement.

Lower court judges in the travel ban case cited Trump’s comments about Muslims as rationale for striking down his executive order temporarily prohibiting travelers from terrorism-compromised countries from entering the United States.

But Chen wrote that the travel ban case is not precedent in the TPS lawsuit for two reasons. Unlike the travel ban order, the judge wrote, TPS does not involve national security considerations. And unlike the travel ban case, the judge wrote, the TPS designation applies to people already in the United States and is not about whether to admit foreigners into the country.

“If the executive branch is not allowed to follow the law … it’s going to be less likely to grant TPS in the future.”

Chen also ruled that the administration failed to explain why it departed from the practice of past administrations, in violation of the Administrative Procedure Act (APA).

Andrew “Art” Arthur, resident fellow in law and policy at CIS, told LifeZette that the administration followed the law set out by the Immigration and Nationality Act. Essentially, Arthur said, the judge told the government, “you have to explain why you’re following the law that no one else did.”

Even if the administration went through the formal rule-making process required by the APA, Arthur said, the judge’s language related to Trump’s comments would make it difficult to end TPS status.

Arthur said Chen’s ruling, if it sticks, “actually raises the bar” for future TPS designations by making administrations hesitant to grant ostensibly temporary protection for foreigners that they may never be able to end.

“If the executive branch is not allowed to follow the law … it’s going to be less likely to grant TPS in the future,” he said. “It will have a ratchet effect.”

Michael Hethmon, senior counsel of the Immigration Reform Law Institute (IRL), said the judge takes an expansive view of the Administrative Procedure Act.

“It’s kind of lame … They’re applying a very fast-and-loose interpretation in a circuit known for fast-and-loose interpretation.”

In reaching his decision, Chen cited arguments from 17 states claiming they would suffer harm from lost taxes. Estimates cited include a reduction of $132 billion in gross domestic product (GDP), $5.2 billion in Social Security and Medicaid taxes, and $733 million in costs to employers.

Related: Quasi-Amnesty to End for 262,500 Salvadorans in U.S. Since Earthquakes

But Vaughan said tax data are meaningless without considering costs. She said plenty of research indicates that immigrants from the affected countries pay less in taxes than they receive in government benefits and other services.

It simply is a matter of average earnings of people with low levels of education and skills, Vaughan said.

“They are a net fiscal drain,” she said. “That’s just the way it is, whether they are Americans or not.”

What’s more, Vaughan said, ending TPS would help the home nations of TPS beneficiaries since they have acquired experience and education in the United States that “they can put to good use” when they return.

“It will help their countries, too,” she said. “They will be an asset to their home countries.”