A federal appeals court Thursday night kept a freeze on President Donald Trump’s executive order restricting refugee resettlement and other forms of legal immigration, meaning those previously blocked from traveling to the U.S. under the action can continue to enter the country as the case makes its way through the legal system.

A three-judge panel with the U.S. Court of Appeals for the 9th Circuit in San Francisco unanimously rejected the government’s assertion that the suspension of the order imperils national security, and ruled that the suing states would suffer “irreparable harms” if travel suspension could carry on.

“The states have offered ample evidence that if the executive order were reinstated even temporarily, it would substantially injure the states and multiple other parties interested in the proceeding,” the court’s ruling stated.

The judges on the 9th Circuit panel were Judge Michelle T. Friedland, appointed by President Barack Obama; Judge William C. Canby Jr., appointed by President Jimmy Carter; and Judge Richard R. Clifton, appointed by President George W. Bush.

The ruling was focused on the narrow question of whether Trump’s executive order should be frozen while courts consider its lawfulness. The government could now ask the Supreme Court to lift the stay of the order, but the ideologically split high court is down a member, and a 4-4 ruling would leave the appeals court decision in place.

Trump quickly turned to Twitter to denounce the decision, writing:

Kellyanne Conway, a counselor to the president, later said in an interview with Fox News that the administration “is fully confident” they will ultimately win in court.

“This ruling does not affect the merits at all,” Conway said. “It is an interim ruling, and we are fully confident that now that we will get our day in court and have an opportunity to argue this on the merits that we will prevail.”

Trump’s executive order, signed Jan. 27, bans Syrian refugees from the U.S. indefinitely, imposes a four-month suspension on all refugee admissions from anywhere in the world, and bars for 90 days people from seven countries the Obama administration and Congress had designated as posing risks of terrorism.

Those countries are Iraq, Iran, Syria, Yemen, Sudan, Libya, and Somalia.

The Trump administration received widespread criticism early on for its chaotic and uneven implementation of the order.

After facing legal challenges, the White House issued guidance clarifying the order does not apply to green card holders—or legal permanent residents—and it granted waivers to Iraqis who assisted the U.S. military, and refugees who had already been screened prior to the order being signed. But that language is not in the executive order itself.

The courts usually defer to the executive branch on issues of national security and immigration policy.

Indeed, federal immigration law states that if the president finds “the entry of any aliens” would be “detrimental” to the country’s interests, he can impose restrictions.

But the appeals court asserted in its ruling that there are checks on these powers. The judges said the government had not provided enough evidence to support a need for the travel restrictions.

“The government does not merely argue that courts owe substantial deference to the immigration and national security policy determinations of the political branches—an uncontroversial principle that is well-grounded in our jurisprudence,” the judges wrote. “Instead, the government has taken the position that the president’s decisions about immigration policy, particularly when motivated by national security concerns, are unreviewable, even if those actions potentially contravene constitutional rights and protections … There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy.”

Hans von Spakovsky, a senior legal fellow at The Heritage Foundation, contended that the court overstepped its bounds.

“This decision has as little basis in the law as the original decision by the district court judge,” von Spakovsky said. “The federal courts are in essence refusing to recognize or acknowledge the authority given to the president by Congress to suspend the entry of aliens into the U.S. The very idea that any foreigner has any constitutional or statutory right to be admitted to the U.S. is absurd. This is just another sign of overbearing federal courts grabbing power from the legislative and executive branches in violation of basic separation of powers principles.”

Other legal experts agreed with the court that Trump’s order went too far.

Lawsuits around the country have alleged that Trump’s order violates the constitution by intentionally punishing Muslims, and many trial courts blocked aspects of the president’s order.

The Trump administration rejected charges of religious intent, noting that most Muslim-majority countries were not included in the order.

The 9th Circuit was ruling on a decision issued in the broadest of the trial court rulings. On Feb. 3, Judge James Robart, a federal judge in Seattle appointed by Bush, issued a temporary restraining order requiring a nationwide halt to Trump’s order—prohibiting federal employees from enforcing it—in a decision that contained little reasoning.

The states of Washington and Minnesota had brought the suit, arguing the executive order harms the state’s residents in areas of employment, education, business, and family relations.

Hundreds of travelers who are citizens of the seven targeted countries have come to the U.S. since Robart issued his order, and those that have been screened can continue to travel here at least until the courts rule on the legality of Trump’s order.

Full court proceedings on the legality of Trump’s order are expected to take months, and with multiple appeals it could take more than a year before the courts make a final decision.