Puerto Rico is not going to get out of its sorry financial state on Walmart’s dime.

A federal judge in the island’s capital city of San Juan ruled on Monday that a new tax Puerto Rico was trying to impose on the retailing giant was illegal.

The tax proposal, which was signed into law on May 29, raised the tax companies pay on goods they buy from “related parties” off the island, from 2% to 6.5%. The law only applied to companies on the island that had more than $2.75 billion in revenues.

Walmart wmt sued Puerto Rico Treasury Secretary Juan Zaragoza Gómez in December, saying that the tax increase violated the commerce clause of the U.S. constitution by unfairly taxing interstate commerce. Before the trial, the company blasted the tax, saying it discriminated against it because Walmart was the only company big enough to pass the revenue threshold.

The retailer said that under the tax it would end up paying 114% of its island profits in taxes and that its operations in Puerto Rico would not be sustainable “for a lengthy period of time” under the new tax.

In his ruling, Judge José Antonio Fusté said that because of Puerto Rico’s miserable financial condition he was not happy to throw out the tax, the New York Times reported, but he said that the island’s economic crisis did not allow it to “take revenue that it’s not entitled to, to pay for essential services.”

Of course Walmart, unlike the judge, was very pleased.

“Today’s ruling is a victory not only for Walmart Puerto Rico but also for our customers, our more than 14,000 Puerto Rican associates, and the many Puerto Rican suppliers, and farmers who depend so heavily on us,” Lorenzo Lopez, a spokesman, told the Times.

Walmart is Puerto Rico’s biggest non-government employer, with 48 stores on the island.

Puerto Rico will appeal the ruling, the island’s treasury secretary said. “We will raise on appeal all the procedural errors that, in our opinion, took place during the trial,” Secretary Zaragoza said in a statement.

The sunny Caribbean island has been trying to find some way to restructure its $72 billion debt pile, a situation so untenable that some experts say that not even bankruptcy could save it. Without the “Walmart tax,” it will have an even bigger hole to fill.

Reuters contributed to this report.