The Trump administration will defend its policy on asylum after a federal judge temporarily halted it as thousands of migrants in a “caravan” wait to enter the United States at Tijuana, Mexico.

Speaking to reporters late Tuesday afternoon, President Donald Trump said he was upset the case has to be appealed to the 9th U.S. Circuit Court of Appeals. One of the most liberal appeals courts in the country, its judges have ruled against other administration policies.

“It’s a disgrace what happens in the 9th Circuit,” Trump said. “We will win this case in the Supreme Court.”

Trump said he would file a “a major complaint” about the 9th Circuit, but didn’t specify to whom he would complain, or what type of complaint it would be.

“Every case gets filed in the 9th Circuit,” the president said. “We get beaten, and then we end up having to go to the Supreme Court. Like the travel ban that we won. The 9th Circuit, we are going to have to look at that.”

U.S. District Judge Jon Tigar of the Northern District of California in San Francisco issued the temporary restraining order against the administration’s asylum rules, which required those illegally crossing the southern border to register at a legal port of entry. Tigar is an appointee of President Barack Obama.

Tigar’s order is effective immediately, but lasts only until Dec. 19, when a new hearing for a longer injunction will occur.

Trump also vented his frustration about Tigar.

“This was an Obama judge, and I’ll tell you what, this is not going to happen anymore,” Trump vowed. “It means an automatic loss, no matter what you do. … People should not be allowed to immediately run to this very friendly circuit and file their case.”

However, as a legal matter, the judge is correct, said David Inserra, a policy analyst at The Heritage Foundation who specializes in homeland security.

“While the Trump administration rightly recognizes that U.S. borders must be protected and that loopholes and poorly [crafted] laws are contributing to illegal immigration at the U.S. border, ultimately it is Congress that needs to fix this mess,” Inserra told The Daily Signal.

“Only congressional action to fix loopholes—such as the Flores settlement, the well-meaning Trafficking Victims Protection Reauthorization Act, and weak asylum laws—can solve the chaos at our southern border and [it] should be the No. 1 priority in the lame-duck period,” he said.

The 1997 Flores settlement established a policy covering minors who crossed the border unaccompanied by adults. It determined that the federal government would release those minors from custody to parents, relatives, or other caretakers after no more than 20 days, or, alternatively, determine the “least restrictive” setting for the child.

The district judge’s ruling almost certainly will be overturned when it reaches the Supreme Court, said Ira Mehlman, spokesman for the Federation for American Immigration Reform.

Mehlman cited the Supreme Court ruling upholding the Trump administration’s policy of “extreme vetting” for travelers to the U.S. from terrorism-prone countries, most of them with Muslim majorities.

Some called the policy a “travel ban,” and critics called it a “Muslim ban.”

“The Supreme Court has already determined the president has authority to decide who enters the country in the travel ban case,” Mehlman told The Daily Signal. “This is just a way for the other side to run out the clock. You can always find an activist judge.”

The judge’s ruling is “absurd,” asserted a joint statement Tuesday from Department of Homeland Security spokeswoman Katie Waldman and Justice Department spokesman Steven Stafford.

“Congress has given the president broad authority to limit or even stop the entry of aliens into this country,” they said, adding:

Further, asylum is a discretionary benefit given by the executive branch only when legal conditions are met and a favorable exercise of discretion is warranted. It is lawful and appropriate that this discretionary benefit not be given to those who violate a lawful and tailored presidential proclamation aimed at controlling immigration in the national interest.

We look forward to continuing to defend the executive branch’s legitimate and well-reasoned exercise of its authority to address the crisis at our southern border.

The American Civil Liberties Union led the lawsuit on behalf of the migrants crossing Mexico from Central America, claiming Trump’s Nov. 9 order violated the 1965 Immigration and Nationality Act. That law states that a foreigner arriving in the United States may seek asylum regardless of whether he or she is authorized to be in the country.

“The rule barring asylum for immigrants who enter the country outside a port of entry irreconcilably conflicts with the INA and the expressed intent of Congress,” Tigar wrote, referring to that law. “Whatever the scope of the president’s authority, he may not rewrite the immigration laws to impose a condition that Congress has expressly forbidden.”