The New Jersey Supreme Court issued Gov. Chris Christie a substantial political victory on Tuesday.

At issue was Christie’s decision last summer to reject a $1.6 billion pension payment in the 2015 fiscal budget. Public sector unions challenged that decision, arguing in court that it violated a 2011 law promising annual contributions to the funds, reasoning with which a lower court agreed. But the state Supreme Court on Tuesday reversed that decision, arguing that the 2011 deal was unenforceable and that the state’s other governmental branches would have to sort out the state’s financial mess.

“That the State must get its financial house in order is plain,” the justices write. “The need is compelling in respect of the State’s ability to honor its compensation commitment to retired employees. But the Court cannot resolve that need in place of the political branches. They will have to deal with one another to forge a solution to the tenuous financial status of New Jersey’s pension funding in a way that comports with the strictures of our Constitution.”

The court, in a 5-to-2 ruling, declared the 2011 agreement unenforceable because such contractual agreements are banned by the state constitution’s debt limitation clause.

The ruling removes what could have been a political headache for Christie, whose years as governor have been defined by the state’s pension problems. The 2011 deal was touted at the time as one of his great achievements. But circumstances changed, and Christie decided, two years in a row, not to fully honor pension payments.

“Promises were made that can’t be kept,” Christie said of the state’s public-employee pension system at a town hall last summer, the first stop on a summertime “No Pain No Gain” tour. In February, he spent most of his State of the State address outlining “an unprecedented accord” with a teachers union, only to have the head of that union suggest that Christie was overselling the discussions.

A ruling for the unions could have fueled criticism that Christie was acting with little regard for the law. But the decision in his favor allows him to continue portraying himself as a leader who’s willing to make difficult choices and fight politically difficult battles.

New Jersey has one of the lowest state credit ratings in the country and has suffered more ratings downgrades under Christie than any other governor, according to at least one ratings agency.

Read more: