President Donald Trump’s trade war suffered a severe blow late Friday, when a federal appeals court stuck down most of his so-called reciprocal tariffs against global trading partners.
The U.S. Court of Appeals for the Federal Circuit upheld an earlier ruling by the Court of International Trade, which found that the tariffs’ legal basis under the International Emergency Economic Powers Act (IEEPA) wasn’t valid, saying that the administration’s argument for the tariffs didn’t constitute an emergency.
“Both the Trafficking Tariffs and the Reciprocal Tariffs are unbounded in scope, amount, and duration,” the majority wrote. “These tariffs apply to nearly all articles imported into the United States (and, in the case of the Reciprocal Tariffs, apply to almost all countries), impose high rates which are ever-changing and exceed those set out in the [U.S. tariff system], and are not limited in duration.”
The 7-4 ruling won’t take effect until Oct. 14, as the court sought to give the Trump administration time to appeal to the Supreme Court. The decision also doesn’t cover sectoral tariffs, such as those on aluminum and steel, that were imposed under a separate legal basis.
The judges also sent the case back to the trade court, which must decide if the ruling applies to anyone affected by the global tariffs or just the plaintiffs who filed the case. They include a collection of Democratic-led states and a group of small businesses.
“ALL TARIFFS ARE STILL IN EFFECT!” Trump said in a post on Truth Social. “Today a Highly Partisan Appeals Court incorrectly said that our Tariffs should be removed, but they know the United States of America will win in the end.”
In fact, the latest ruling marks the administration’s third defeat in court. In addition to the Court of International Trade, U.S. District Judge Rudolph Contreras had also found that IEEPA doesn’t give Trump the power to impose most of his tariffs.
Trump’s “Liberation Day” tariffs—which shocked global markets on April 2 and triggered a massive selloff—helped leverage a series of trade deals. That includes an agreement with the European Union, which pledged to invest $600 billion in the U.S. and buy $750 billion worth of U.S. energy products, with “vast amounts” of American weapons in the mix. Similarly, the U.S.-Japan trade deal entails $550 billion in investments from Tokyo.
Meanwhile, the reciprocal and sectoral tariffs are expected to generate $300 billion-$400 billion a year, a huge revenue windfall that was seen propping up the fiscal outlook.
Last week, the Congressional Budget Office estimated that tariffs would shave trillions of dollars off the federal budget deficit. Meanwhile, S&P Global reaffirmed its AA+ credit rating and stable outlook on U.S. debt last week owing in part to “robust tariff income,” which should help offset the impact of tax cuts and spending in the federal budget.
But if the decision remains in place and applies to everyone affected, importers that paid the IEEPA tariffs could demand reimbursement from the federal government.
Ahead of the ruling, there were hints that the court might rule against the administration. Earlier this month, Solicitor General D. John Sauer and Assistant Attorney General Brett Shumate sent at letter to the court warning of an apocalyptic doomsday outcome if the tariffs were struck down.
“In such a scenario, people would be forced from their homes, millions of jobs would be eliminated, hardworking Americans would lose their savings, and even Social Security and Medicare could be threatened,” they wrote. “In short, the economic consequences would be ruinous, instead of unprecedented success.”
The sudden dire tone suggested to some on Wall Street that the Trump administration expected to lose in the federal appeals court.
James Lucier at Capital Alpha Partners said in a note earlier this month that Trump doesn’t have the legal authority to replicate the IEEPA tariffs under other tariff statutes. For example, the sectoral tariffs were imposed under separate authorization based on national security.
“In other words, the president is in a jam because if the court strikes down the IEEPA tariffs, his trade deals have no legal basis,” he wrote.
In another note on Wednesday, Lucier predicted that while the case is appealed to the Supreme Court, most countries would adhere to their trade deals with the U.S. to avoid antagonizing Trump, even if the administration has to come up with a new legal justification for its tariffs.
But trading partners that held off on immediately retaliating against the U.S. may become more willing to strike back over time, changing negotiations over the details of any trade deals that haven’t been fully fleshed out, he added.
“This could lead to months of uncertainty in global trade as the tariffs collected under IEEPA are refunded and the U.S. switches to a different set of levies,” Lucier warned. “Trading partners who cooperated with Trump may be less willing to cooperate the second time around.”
This story originally appeared on Fortune