(WXYZ) - Wayne County now has to pay $32 million back into its retirement system.
The Michigan Court of Appeals issued the ruling on Friday.
County Executive Robert Ficano took the money from the so-called 13th check fund a few years ago to make a payment into the county's retirement system.
Pension lawyers had argued that the move was illegal.
Now the money has to be paid back.
The 13th check was created decades ago to help retirees with rising cost of living expenses.
A spokeswoman for Ficano says they plan on appealing the decision.
The Commission and the CEO believe the 13th check cannot be sustained considering the county's $189 Million deficit. The Court of Appeals did uphold the Commission's restrictions on the 13th check going forward.