AUGUSTA, Maine — Lawmakers completed work Wednesday night on a legislative session that began in political uncertainty after last November’s Republican takeover but that saw bipartisan compromise on major issues ranging from tax cuts to regulatory reform.

But Republican Gov. Paul LePage, whose brash style and lack of legislative experience made him the wildcard of the session, generated a buzz on the last day when he thanked lawmakers while continuing to push aspects of his controversial agenda that failed this year.

“There is a lot that needs to be done,” LePage told lawmakers in a closing address. “We can’t do it all in one session.”

Maine’s first Republican-controlled Legislature in decades already had finished work on most of the major issues before Wednesday but spent the day mopping up a few dozen issues.

In the last major vote of the session, the Senate narrowly approved a bill that rewrites Maine’s complicated school funding formula. Supporters claimed the measure was necessary to help rural schools but opponents cautioned it would shift money away from service center communities such as Bangor and Portland.

Other action on the Legislature’s final day included:

• Passage of a bill to allow Hollywood Slots in Bangor to add poker, blackjack and other table games. Supporters brokered a last-minute compromise with the LePage administration requiring Hollywood Slots to receive approval from voters in Penobscot County rather than simply Bangor voters.

• Approval of legislation legalizing some fireworks in Maine. The bill will not take effect in time for this July Fourth, however.

• Formal rejection of a bill authorizing new racinos in Biddeford and Calais. Instead, voters statewide will get a chance to weigh in on the issue as well as a separate proposal for a racino in Lewiston this November.

• Passage of a bill outlawing the sale and possession of “bath salts”, drugs that have burst onto the scene in recent months, resulting in overdoses, dangerous hallucinations and drug-related crime around the state.

• A ceremony signing into law a bill that will allow the creation of 10 publicly funded charter schools.

But lawmakers from both parties said the highlight of the session was the bipartisan work to pass a $6.1 billion budget. The two-year spending blueprint features the largest tax cut package in Maine history, pension reforms that reduce Maine’s unfunded liability by $1.7 billion and increased spending on K-12 education.

Lawmakers also enacted a package of regulatory reforms — albeit much less sweeping than the LePage administration had wanted — and continued to pay down Maine’s debts to hospitals while enacting modest welfare reform.

“If you look at the accomplishments of this session, they are absolutely amazing,” said Sen. Jonathan Courtney, R-Springvale, the Senate majority leader. “They said we couldn’t do it. And you know, Republicans couldn’t have done it. Democrats couldn’t have done it. But we could do it together.”

But there were several high-profile partisan clashes. Arguably the two biggest political fights were over Republican-backed bills to end Election Day voter registration and a health insurance reform bill. Both bills passed after largely party-line votes.

“I think the tone of this session, with the exception of Election Day registration and the health insurance bill, was not about Republicans vs. Democrats,” said Rep. Emily Cain, D-Orono, the House minority leader. Instead, the parties put people and issues first, she said.

For his part, LePage praised the Legislature’s work to reduce taxes, address Maine’s pension liability, improve the state’s business climate through regulatory reform and controversial efforts to lower health insurance costs.

“I think there has been some great work done,” LePage told House members. “I think some of the work that was done was excellent.”

But hours after the governor jokingly refrained from rating the session because he didn’t want “to piss them off” as lawmakers worked on bills, LePage succeeded in offending Democrats with some of his closing remarks.

The governor caused the biggest stir when he pledged to continue fighting next year to repeal “fair share,” which is the requirement that state employees who opt out of union membership still must pay a fee because they benefit from union services.

LePage stated that unions could “force someone to pay to keep a job,” which is illegal in Maine.

“I thought it was a temper tantrum beneath the office,” said Rep. Michael Carey, D-Lewiston.

Reacting to the speech, Cain accused the governor of taking “a threatening tone with the Legislature” and warned lawmakers to brace for much more challenging political fights next year.

But Courtney, the Senate majority leader, credited LePage with challenging the Legislature.

“I’m sure he will continue to stir things up and we will continue to be deliberative and work with him,” Courtney said.