Months of negotiations have yielded a firefighters pension compromise that ought to be an example for others as a way to get a handle on the costs of public employee retirement benefits.

The four bills headed to Gov. John Bel Edwards are aimed at settling a decades-old feud between firefighters and the city of New Orleans.

A lot of players worked on the compromise package, including Democrats willing to tackle the unions’ hardline position in the years of contention over these issues. The package was proposed by Mayor Mitch Landrieu and carried by key leaders, including the author of the bills, state Rep. Walt Leger, D-New Orleans.

The legislation represents part of a larger settlement of a dispute that has been going on for nearly 40 years between successive mayors and city firefighters over back pay and pension support. The battle most recently included dueling accusations about who was most at fault, two lawsuits, tens of millions of dollars in damages, and the threat of a contempt of court finding that nearly ended up with Landrieu being placed under house arrest.

Generally, under the pact, newly hired firefighters will have to work longer before retiring and receive less in benefits. The changes, though, are phased in slowly, an essential political element in dealing with the expectations of current retirees and those soon to retire.

It’s a lesson in constructive gradualism.

House Bill 56, would raise the retirement age from 52 to 57 and lower the rate by which retirement benefits are calculated. House Bill 57 would base the contributions to the retirement system on compensation instead of salary, because compensation includes factors such as overtime and lump-sum payments. House Bill 59 codifies the way sick and annual leave are treated in calculating benefits.

A fourth measure, House Bill 58, deals with the thorny case of about 60 firefighters who took optional retirement “drops” before the settlement was reached.

All the bills were part of a wider settlement worked out by the city, including many changes made by the pension system board. Those positive changes, though, had to be supplemented by some bills in the Legislature, because the state continues to control what should be a purely municipal system.

We commend the Landrieu administration and all those working to put the firefighters system on a sounder financial footing for the long term. It will be costly, as voters in April rejected a public safety millage that included funding for the firefighters; the new system will be financed in the short term by about $8 million in additional costs, borne by city revenue that would otherwise go to public services in New Orleans.

While the firefighter system in New Orleans for various reasons — including mismanagement of investments, in decades past — was a worst-case scenario, taxpayers nationwide are on the hook for trillions, literally, in future retirement costs for public employees.

The bills aren’t due tomorrow, because people will retire over time. But the costs are real and represent significantly higher benefits than ordinary working people earn in the private sector, where investment-based retirement plans have become the norm.

If government is going to allow “defined benefit” retirements for employees that are more generous than the taxpayers get in their working lives, there is a clear disconnect — and a looming political problem for unions, in particular, trying to protect the plans.

Financial reality has to be enforced, but that is politically difficult. The New Orleans bills represent a compromise, but one that is healthier for the long-term financial prospects of the city as well as its future employees.