A court in Puerto Rico has ruled that a deal calling for the U.S. territory's government to repay $230 million to one of the island's biggest banks is valid.

The ruling issued late Friday by the Court of First Instance aims to resolve a lengthy financial feud between the government and Doral Financial Corp.

Doral Bank had argued it was owed a $230 million refund in overpaid taxes. The government originally agreed the bank had the right to request the refund but then sought to back out of the deal.

Doral officials are welcoming the court ruling, but Puerto Rico's Treasury Department says it will appeal.

The ruling comes as Puerto Rico struggles with $73 billion in public debt and enters its eighth year in recession.