President Donald Trump overstepped his authority in implementing his controversial travel ban, a federal appeals court ruled late Friday.

“The proclamation, like its predecessor executive orders, relies on the premise that the Immigration and Nationality Act vested the president with broad powers to regulate the entry of aliens,” a three-judge panel in San Francisco wrote in a unanimous ruling. “Those powers, however, are not without limit. We conclude that the president’s issuance of the proclamation once again exceeds the scope of his delegated authority.”

According to the judges, Trump improperly bypassed Congress in enacting the travel ban — and failed to make a “legally sufficient finding that the entry of the specified individuals would be ‘detrimental to the interests of the United States.’”

“The president cannot effectively abrogate existing immigration law while purporting to merely strengthen it,” the judges wrote. “The cure cannot be worse than the disease.”

Trump’s third travel ban — which the Supreme Court allowed to take effect earlier this month — restricts travel into the United States by citizens of Chad, Iran, Libya, North Korea, Somalia, Syria, Venezuela and Yemen.

Opponents say that the ban discriminates on the basis of religion; most of the nations on the list are majority-Muslim.

But the Supreme Court ruled Dec. 4 to allow the measure to take full effect — superseding the lower court rulings — pending appeals.

“It’s unfortunate that the full ban can move forward for now, but this order does not address the merits of our claims,” Omar Jadwat, director of the American Civil Liberties Union’s Immigrants’ Rights Project, said in a statement. “We continue to stand for freedom, equality and for those who are unfairly being separated from their loved ones.”

The ruling — which argues that the injunction against the ban put in place by a federal judge in Hawaii should remain throughout the appeals process — does not immediately change the implementation of the law, as the Supreme Court’s earlier ruling supersedes it.