PORTLAND, Maine — The Maine Supreme Judicial Court in a 4-to-1 decision Thursday said that Somerset County officials were wrong to withhold boarding fees for federal prisoners from the now defunct Board of Corrections.

A majority of the justices also found that the board in 2013 properly reduced the state funds it funneled to the Somerset County Jail by more than $280,000 to make up for the loss in revenue.

The 23-page majority opinion, written by Justice Jeffrey Hjelm, reversed a lower court decision that said Somerset County could use the money it received for boarding federal prisoners to pay off debt it incurred when it built its new jail in 2008 in East Madison rather than using it to support the cost of corrections.

Efforts to reach Somerset county officials and the attorneys who argued the case were unsuccessful Thursday afternoon.

The argument started in 2013, when the Board of Corrections, which was disbanded last year, refused to pay Somerset County its anticipated third-quarter payment for the fiscal year after county officials used income from boarding federal inmates to pay down construction debt.

Maine Supreme Judicial Court Justice Donald Alexander, sitting as a Superior Court justice, ruled in February 2014 that the Board of Corrections was wrong to withhold the third-quarter payment and the board fees could be used to pay down debt. The state appealed that decision. Justices heard oral arguments in November 2014.

Chief Justice Leigh Saufley and Justices Ellen Gorman and Joseph Jabar joined Hjelm in the decision Thursday. Justice Andrew Mead issued the lone dissent. Retired Justice Warren Silver heard oral arguments but retired before the case was decided. Alexander recused himself from the appeal.