Speaker William J. Howell (R-Stafford), 2nd from left, confers with, from left, Del. Terry G. Kilgore (R-Scott), House Majority Leader M. Kirkland Cox (R-Colonial Heights), Del. David B. Albo (R-Fairfax) and House Clerk G. Paul Nardo on March 2, 2016 in Richmond. (Bob Brown/Richmond Times-Dispatch via AP)

Virginia lawmakers finished their work late Friday one day ahead of schedule and sent Gov. Terry McAuliffe (D) a budget that would give teachers raises and increase spending for education and economic development.

The Republican-controlled General Assembly’s passage of a two-year, $105 billion spending plan caps a frenzied legislative session marked by extremes. McAuliffe and lawmakers struck a compromise on gun laws but feuded bitterly over the next state Supreme Court justice.

“While I am pleased at the balance of our work, I must express my deep remorse at the opportunities lost this year to disorder and acrimony,” McAuliffe wrote in a letter to lawmakers.

But Republican House leadership praised what they called “a productive and successful” session in which “conservative values” prevailed.

“Washington and Richmond are only 90 miles apart on the map, but we are worlds apart when it comes to governing,” Speaker William J. Howell (R-Stafford), Majority Leader M. Kirkland Cox (R-Colonial Heights) and others said in a statement.

It’s now McAuliffe’s turn to review the budget as well as controversial bills that would block the state from punishing people who discriminate against same-sex couples and would let parents prevent their children from reading books with sexually explicit content in schools. The General Assembly also sent a bill that would allow Virginia to use the electric chair on death-row inmates when lethal-injection drugs are not available.

For the third straight year, the Republican-controlled General Assembly denied McAuliffe and Democrats expansion of Medicaid and rejected the governor’s plan to tax hospitals and use the revenue to fund the state’s share of the federal health-care program.

“We don’t have any answer for the 400,000 Virginians who don’t have any health-care coverage,” Del. Marcus B. Simon (D-Fairfax) said. He was the only House Democrat to join seven Republicans in voting against the spending plan.

While enmity over health care is likely to linger, lawmakers and McAuliffe sprang a fragile compromise regarding gun laws on the legislature early in the session and clinched the deal with a bill-signing at the executive mansion, the first time he used the historic home for that purpose.

McAuliffe spent political capital on a deal that expands the rights of concealed-carry handgun permit holders in Virginia and around the country in exchange for tighter restrictions on domestic abusers and voluntary background checks at gun shows. The legislature’s budget plan includes $400,000 to pay for the checks.

When it comes to education dollars, lawmakers sought to restore funding that was cut during the recession, and they gave teachers a 2 percent pay raise in the first year of the budget. State employees and college faculty would get a 3 percent raise.

McAuliffe wanted to increase funds for struggling schools and hire 2,500 teachers — one additional teacher for every public school in Virginia. But lawmakers preferred to increase funding that they said has “fewer strings attached.”

When it comes to additional funding to balance the high cost of living for Northern Virginia schools, the House and Senate compromised on $36 million, more than the Senate wanted to spend and less than the House proposal.

The legislature’s economic development plan devotes $35 million to Go Virginia, a regional grant program that shifts power from the administration to busi­ness­ peo­ple and creates a framework to promote “research, development and commercialization.”

One beneficiary of that program would be the Inova Center for Personalized Health, the newest campus of Northern Virginia’s largest hospital system.

Lawmakers also directed their research arm, the Joint Legislative Audit and Review Commission, to oversee economic-development spending and tax preferences, a measure that circumvents the governor, who is limited to one four-year term.

The plan calls for a $2.1 billion bond package, which falls about $300,000 shy of McAuliffe’s proposal.

Lawmakers included a provision that says all the projects are contingent on McAuliffe’s releasing the funding for a long-delayed overhaul of the Capitol Square office building where lawmakers conduct their business during session. The governor has withheld funding in the past in a pointed dig at his GOP rivals.

Lawmakers gave themselves a pay raise in the form of an increase in the stipends they earn for attending meetings around the state while the General Assembly is not in session. Instead of $200, they’ll receive $300.

The budget plan did not include as much money as Senate Majority Leader Thomas K. Norment Jr. (R-James City) wanted for more staff “for Senate leadership.” Instead, the House agreed to about $187,000 each year for salaries, but the Senate clerk will decide how to distribute it.

The unseasonably warm weather in the final days of the session created a spring-fever-like mood among delegates who cheered “Sine Die,” while on the other side of Mr. Jefferson’s Capitol, senators rose one by one to air their grievances.

On the court fight, Republicans ultimately outmaneuvered McAuliffe with a threat to install the polarizing former attorney general, Ken Cuccinelli II, in place of former Fairfax Circuit Court judge Jane Marum Roush. Lawmakers ultimately selected Stephen R. McCullough, a state court of appeals judge.

“The firing of a highly qualified Supreme Court Justice and the haphazard process for replacing her was an unprecedented political affront to the independence of our judiciary,” McAuliffe said.

Just when the drama appeared over Friday, Sen. Charles W. Carrico Sr. (R-Grayson) revealed a final twist. He rose on the Senate floor and said McAuliffe offered to trade a coal tax credit important to Southwest Virginia Republicans for their support of Roush. Lawmakers balked, and each side ended the session lacking something it had wanted.