AUGUSTA, Maine — Lawmakers worked into Saturday morning as they put the finishing touches on a $6.3 billion bipartisan budget that temporarily raises the sales tax while shifting more costs to cities and towns.

The budget-writing Appropriations and Financial Affairs Committee approved the final bill just after midnight, finishing up two marathon days of meetings.

Some on the panel had been up for more than 40 hours straight as they congratulated each other on a bipartisan bill that was unanimously approved.

“This is the toughest budget I have ever done,” said House Chairwoman Peggy Rotundo, D-Lewiston. “In many ways, it breaks my heart.”

Rotundo has served four terms in the state Senate and is on her fourth term in the House.

“We work for the people of Maine and not for our parties,” Rep. Dennis Keschl, R-Belgrade, told his colleagues after the vote.

The bill likely will go to the House of Representatives late next week for a vote.

Rotundo said earlier she was satisfied with the bipartisan and unanimous work the committee did but noted that the budget will still shift more costs to cities and towns and ultimately to property taxpayers.

“I’m very proud of the fact that given the budget that we were presented with by the governor, with massive cuts, we were able in a bipartisan manner to do as much restoration as we were able to do,” she said.

The committee restored about 65 percent of the $400 million in state revenue-sharing that LePage had eliminated in his proposal. Rotundo said the panel left intact about $400 million in income-tax breaks passed by the previous Republican-controlled Legislature.

She said that concession was a difficult one for Democrats who believed the tax breaks largely benefit Maine’s wealthiest citizens. Republicans have frequently noted that the tax cuts eliminated state income tax for nearly 70,000 low-income Mainers.

“All communities take a hit,” Rotundo said.

The committee reached consensus and agreement on most of the budget early Friday morning after working through the night Thursday.

Beyond the revenue-sharing restoration, key achievements for the panel include continued funding for two property tax relief programs that LePage’s budget proposed to scale back. The committee restored the Homestead Exemption program and replaced the circuit breaker program with a “property tax fairness” exemption that will kick in automatically when residents file their state taxes.

The proposed spending plan also raises the sales tax from 5 percent to 5.5 percent and the meals and lodging taxes from 7 percent to 8 percent. The bill includes language that forces those taxes to revert back to current rates in 2015.

To pass the Legislature the budget needs a two-thirds vote in both the House and Senate. The measure also would require two-thirds to favor it if LePage uses his veto pen on it. Lawmakers hope to pass the spending plan by June 19, and the budget must go into effect by July 1 to avert a state-government shutdown.

“Maine does not have a revenue problem; Maine has a spending problem,” LePage said in his pre-released radio address that airs on several radio stations, including MPBN, on Saturday. “We spend more on government than we have money to pay for it. We are victimizing the taxpayer to pay for government greed, and we are ignoring our most needy, our disabled and our elderly.”

In the radio message, LePage said he didn’t intend to allow state government to shut down, but he said the responsibility for preventing a shutdown lies with Democratic leaders in the Legislature.

Rotundo said she couldn’t predict what LePage would do, but she said she believes lawmakers should have enough support to override a veto.

“When you want to get a two-thirds budget, you don’t get everything you want,” Rotundo said. “It’s about compromise.”

While Democrats are likely to back the budget deal, it’s less likely to go over well with Republican lawmakers, who hold minorities in the House and Senate. Some Republican support will be needed, however, to override a LePage veto. That hasn’t happened yet this session, as Republicans have helped sustain 11 of LePage’s vetoes.

“We were so close to making some structural changes that were desperately needed within state government and, unfortunately, we’re going to ask for folks to make the change in their own home budgets in order to fund state government,” said Senate Minority Leader Michael Thibodeau, R-Winterport.

“We had a real opportunity here to maybe end some programs that are nonessential functions of state government, and we didn’t have the political will as a body to do that,” he said, citing funding for the state’s clean elections program and energy efficiency programs as examples.

Municipalities are still going to feel the pinch and local selectmen and city and town councils will now wrestle with reducing services or increasing property taxes.

“We were discouraged in the last few years when there have been raids on revenue-sharing,” said Kate Dufour, senior legislative advocate at the Maine Municipal Association. “It’s now a common occurrence, and that is incredibly discouraging.”

Lawmakers said the tax increases included in their budget proposal would raise $178 million for state coffers, allowing them to restore $125 million of the $200 million per year in revenue-sharing funds suspended in the LePage proposal.

Programs restored by the committee include the low-cost Drugs for the Elderly program; General Assistance; Head Start; Women, Work and Community; and other job-training programs.

The committee approved spending more on public education to bring funding to the level it was in the current biennium before LePage cut $12.6 million in school aid as part of a larger spending curtailment.

The additional education funding will come in part from using $13 million in casino revenue from the Oxford Casino for General Purpose Aid to Education.

In addition, the budget includes nearly $9 million to restore merit and longevity pay for state employees who haven’t seen a pay increase for more than four years.