Nobody looked good in this year’s session of the Virginia General Assembly. As the legislature in Richmond closed Saturday, two main lessons emerged.

Lesson one: Republican Gov. Robert F. McDonnell was too weak a leader to keep his party in line.

Lesson two: The Democrats in the legislature were too inept to take advantage of lesson one.

The outcome raised doubts first about the legacy that McDonnell will leave when he steps down in early 2014. He had to settle for, at best, a mixed record of accomplishments in what was arguably the most important legislative session he’ll have as chief executive. (Like all Virginia governors, McDonnell is hampered by the ban on succeeding himself.)

McDonnell fell victim to both wings of his party. Moderate Republicans shot down one of his signature goals , a bill designed to make it easier to fire incompetent teachers. Conservatives pushed ahead assertively on socially divisive issues such as abortion and gun rights, making a joke of the governor’s repeated appeals to keep the focus on practical topics, like jobs.

McDonnell “obviously didn’t have enough control over his own party,” said Quentin Kidd, a political science professor at Christopher Newport University in Newport News. “In terms of non-budget items, I think he had a really tough session. What we’re going to remember are the social issues.”

Kidd and other analysts warned that the conservatives’ offensive, and the liberal backlash, could mark a turning point in Richmond away from the so-called Virginia Way of bipartisan civility.

“The larger legacy of Bob McDonnell’s term could be that this was the year that Virginia politics turned sour, the year that the Virginia Way finally gave way to the reality of stark divisions, with social issues drawing lines between the parties,” Kidd said.

Meanwhile, Senate Democrats wasted a perfect opportunity to cast the Republicans in a negative light. They drew attention away from McDonnell’s problems by refusing to approve a budget on time, in a battle over committee assignments that only insiders understood.

The delay means a special legislative session will be required later this month. The episode confirmed the public’s worst expectations — that politicians care more about their own privileges than about sworn duties of vital significance.

Republicans couldn’t believe their good fortune, as the Democrats’ obstructionism became the top story in Richmond. The news media stopped talking about the new, GOP-backed law requiring women seeking abortions to first get ultrasounds, which had made Virginia Republicans a national symbol of social conservative excess.

“The Democrats gave McDonnell a get-out-of-jail-free card,” said a high-ranking, Virginia Democratic operative, who spoke on the condition of anonymity to be free to criticize his party.

“To be in this position of strength and then squander it, and undermine the entire brand that Virginia Democrats have painstakingly built on budget issues over the last decade, is just malfeasance,” he said.

This session was critical for McDonnell. Because of Virginia’s two-year budget cycle, this will be the only budget that he oversees from conception to implementation. Also, for the first time since he took office in early 2010, Republicans controlled both chambers of the legislature.

McDonnell doesn’t have much that’s memorable to show for it, although he did get a deal late Saturday on state pension changes. The governor would also like to claim as a legacy that the state will be channeling more money to the state university system in the future. But Democrats say it’s too little to catch up with North Carolina, Michigan and other states with highly regarded public university systems.

McDonnell also just completed the third of four legislative sessions without finding new, adequate streams of funding for Virginia’s roads. That was one of his top objectives when he ran for office.

“His agenda got sidetracked,” said Mark J. Rozell, professor of public policy at George Mason University. “It looked like the hard right-turn session that McDonnell had urged legislators at the outset to avoid.”

The Democrats, for their part, were backpedaling furiously at the end of the week to try to minimize the political damage from their own overreach in blocking the budget. Senate Minority Leader Richard L. Saslaw (D-Fairfax) insisted that any public irritation would evaporate quickly.

“This idea that the argument over power sharing [in committees] means we weren’t going to have a budget, that goes over people’s heads. It’s going to be a long time before anybody forgets these [GOP] antiabortion bills,” Saslaw said.

He might be right. But it’s hardly a ringing endorsement of one’s own strategy to hope the voters will forget it.