MONTGOMERY COUNTY spent years digging its budgetary pit. Now it is coming to grips with the closely linked problems of unaffordable spending and overbearing unions.

In making even deeper long-range cuts to benefits, pensions and schools than the already extensive ones proposed by County Executive Isiah Leggett, the County Council is set to adopt a spending blueprint that starts to chart a responsible course. Montgomery’s $4.4 billion budget, scheduled for adoption Thursday, puts the county on course to slash $500 million in spending over the next six years. About half the savings derive from shifting a greater portion of pension and health coverage costs from taxpayers to the 30,000 county government and school employees.

The other chunk of potential savings comes from breaking away from a state-mandated education-funding formula, which had locked the county into an unsustainable trajectory. That misguided state mandate has now been rejected by six Maryland counties, including Montgomery.

This is a watershed moment. For the first time in memory, the county schools’ roughly $2.1 billion budget will actually shrink, albeit by less than 1 percent, and largely because federal stimulus funding has dried up. Also for the first time in memory, benefits and pensions for county employees will shrink, and thousands will pay several hundred dollars more for health insurance annually.

The council is delaying until January the higher premiums that will come out of workers’ paychecks. Critically, it is also trying to spread the burden equitably among the ranks of county employees, including police, firefighters, office workers and even teachers, who were previously shielded from austerity measures such as furloughs.

No one relishes squeezing the county’s able workforce, least of all members of the all-Democratic County Council, who had previously balked at balancing the budget “on the backs of workers,” as current Chairwoman Valerie Ervin put it three years ago. But as Ms. Ervin herself came to recognize, the recession changed the game. If the council had not targeted the 82 percent of county spending that goes to personnel, it would have been forced to gut funding for libraries, parks, transportation and social programs, which have already suffered staggering cuts in the past three years.

Unsurprisingly, public employee unions and school board members have reacted with fury, threatening electoral payback and unspecified labor unrest. School board members, in thrall to the teachers union, have warned of terrible consequences in the classrooms.

In fact, Montgomery’s highly regarded teachers will remain among the best-paid in this (or any other) region. It’s a stretch to suggest that increasing their share of health costs from 5 percent to 10 percent — still very low by most standards — will have a ruinous effect on students.

Montgomery is not out of the woods. The county continues to suffer the effects of having more than doubled benefit and pension spending in the past decade, to a level far beyond the norm in other municipal governments, let alone the private sector. But with this spending plan, it has at last begun to embrace some discipline.