It’s hard to believe that two political parties with such conflicting views on taxation and spending priorities could be as thrilled as Republicans and Democrats claimed to be with the $6.1 billion biennial budget approved by the Legislature and delivered to the governor last week.

Members of MaineToday Media’s editorial board met with leaders of each party as the budget neared final passage and we were amazed to hear Democrats, who had no use for the budget’s $153 million in tax cuts, and Republicans, who settled for much less in the way of tax reduction than Republican Gov. Paul LePage had requested, fall all over themselves praising the budget and the process that produced it.

Apparently, a wave of bipartisanship has rolled across the State House and left its denizens awash in good will and a spirit of cooperativeness.

As this was written on Friday afternoon, the only question was whether that spirit would extend to LePage and inspire him to sign the budget bill. Republicans and Democrats alike were cautiously optimistic that it would.

As a political document, the budget that made its way to the governor’s desk left a lot to be desired, particularly from the standpoint of Le-Page – the governor had asked for $50 million more in tax cuts than the Legislature gave him – and House Democrats, whose leader said her caucus “hates” the tax cuts that survived.

But as a product of legislative workmanship and bipartisan ingenuity, the budget might reasonably be described as a masterpiece.

Unlike most other bills, the budget requires a two-thirds majority in the House and Senate in order for it to take effect by the July 1 start of the state’s new fiscal year, thus presenting challenges that some feared might be insurmountable in a closely divided Legislature.

Gov. LePage had asked the Legislature not only for major tax cuts and spending reductions but for a philosophical shift in budget priorities that affected state employees’ pensions, the state’s regulatory system and the “safety net” of welfare and social programs that provide assistance for a wide range of needy residents.

Early in the legislative session, LePage had stated publicly that he expected lawmakers to give him everything he asked for and would veto any budget that fell short of his blueprint.

Even with narrow majorities in both the House and the Senate, Republicans knew they would never muster two-thirds support for the governor’s original budget, so they set about working with Democrats to craft a spending plan that could win the needed votes – and working with the governor to win his support for the necessary compromises.

In the end, Republicans agreed to trim the total tax cut, but won key rollbacks in the income tax and estate tax. The parties also hammered out compromises on pension reform, health care spending and a number of other budget items that were less controversial and visible but no less important to their advocates on both sides.

No one would be shocked if LePage declared these deviations from his proposed budget too drastic to accept and vetoed the bill, or took the less combative option of allowing the bill to become law without his signature.

Republicans gave up a lot in crafting their budget deal with Democrats. Even if the governor decided to accept the changes in the interest of adopting a budget, the compromises would be difficult for him to swallow.

Not so much for legislators, however, who couldn’t stop trumpeting their triumphant effort.

“The best work we do, we do together,” House Minority Leader Emily Cain said as the budget was finalized on Thursday, adding, “We might not agree on everything, but compromise is never perfect. Today’s vote shows how far we’ve come. It demonstrates that if we honor and respect the process, we can come to agreement.”

Senate President Kevin Raye praised the budget as a “crowning achievement” made possible by a process that was “characterized by patience, by listening, by being thoughtful, and demonstrating mutual respect.

“The seeds for this successful conclusion of the biennial budget process were sown at the outset of the Legislature when we made the affirmative decision to pursue a bipartisan, two-thirds budget, and to afford all members, majority and minority alike, the respect of full participation in that process.”

House Speaker Robert Nutting weighed in as well: “All Mainers will benefit from this spending plan that will bring significant tax relief, save hundreds of millions of dollars in pension costs and put our state on a path to fiscal responsibility.”

For the record, we supported many of the governor’s original proposals and would have preferred to see more of them enacted, particularly in the areas of taxation and pension reform. That said, we’ll echo Nutting’s assessment that the budget moves the state in the right direction.

In the opinion business, we sometimes write an editorial that everyone hates and we figure we must have done something right – must have hit some raw nerves and touched on a painful truth or two that agitated those on both sides of a debate.

In the business of politics and government, the usual goal, it seems, is to do the opposite: to pass laws and adopt policies that make everyone happy.

This state budget that Republicans and Democrats have carved out through negotiation and compromise actually does a little of both by cutting spending and providing tax relief, in doses that somehow bridge the gulf between diametrically opposed philosophies of government.

That’s no small accomplishment in an age of governmental gridlock and legislative paralysis. The legislators who achieved it deserve the praise they’re getting, even if they’re getting it mostly from themselves.