Doral Financial suffered another setback as a Puerto Rican court ruled that the company is not entitled to a $230 million refund tied to overpaid taxes.

The San Juan, Puerto Rico, company vowed that it would appeal Wednesday's decision by the Circuit Court of Appeals of Puerto Rico. Doral filed a lawsuit in June, claiming that Puerto Rico's government wrongfully voided a 2012 agreement for the tax refund. Doral won an initial victory in October when Puerto Rico's Court of First Instance ruled that the $5.9 billion-asset company was entitled to the funds over a five-year period.

The latest court ruling "seriously degrades the rule of law by empowering the government to disregard contracts on little more than a whim," Matthew McGill, a lawyer at Gibson, Dunn & Crutcher who represents Doral, said in a press release. "With the Garcia-Padilla administration now actively searching for ways to evade its legal obligations, the issues raised by Doral's case are even more important today than when the [territory's government] first capriciously nullified Doral's agreement."

The Puerto Rican government hailed the decision, praising the appellate court's determination that Doral had not overpaid.

"This has been a very tough battle, but we were always committed to our moral and legal obligation to defend the people of Puerto Rico against this inappropriate disbursement of $229 million of public funds," Secretary of the Treasury Juan Zaragoza said in a press release. "No taxpayer can be above the law and public order."

The legal battle between began last May, when Puerto Rico's Treasury Department voided the tax-refund agreement.

Doral's troubles extend back almost a decade, when the company restated several years of earnings to adjust how it calculated the fair value of floating-rate interest-only strips. The move cut into several years of profit, causing the company to claim it overpaid its taxes.

Doral's capital levels plunged last year, when the Federal Deposit Insurance Corp. determined that the company could no longer count the money towards its Tier 1 capital.

Doral disclosed on Wednesday that it was viewed by regulators as "critically undercapitalized." It was also recently put under a prompt corrective action directive, which is often considered one of the last public warnings before a bank goes into receivership. Industry experts have warned that Doral is quickly running out of options and management has acknowledged that failure was a possibility.

Subscribe Now

Access to authoritative analysis and perspective and our data-driven report series.

14-Day Free Trial

No credit card required. Complete access to articles, breaking news and industry data.