Robert Sarvis, the Libertarian candidate for Virginia governor in 2013, almost cost Democratic nominee Terry McAuliffe the election. Republican candidate Ken Cuccinelli’s campaign had relentlessly attacked Sarvis during the last three or four weeks leading to November 5, and may have carved off enough Sarvis supporters to give McAuliffe the edge he needed to win.

Sarvis had 145,560 votes, or 6.6 percent, the best showing by a Libertarian statewide candidate in Virginia history and the best third-party gubernatorial result since Henry Howell ran in 1973, a year without a Democratic nominee. McAuliffe had 48 percent of the vote and Cuccinelli had 45.5 percent, giving the Democrat a margin of victory of 2.5 percent.

According to exit polls, liberal and moderate voters preferred Sarvis by nearly 6 to 1 over conservative voters. Nearly half of Sarvis voters told Quinnipiac that McAuliffe was their second choice.

Dave Weigel noted in Slate:

Sarvis drew 3 percent of Democrats, 4 percent of Republicans, and 15 percent of independents—and Cuccinelli ended up with a plurality of independents after polling behind among them. Inconclusive? OK: Sarvis won 4 percent of “liberals” and 3 percent of “conservatives.” The most Cuccinelli-friendly, reality-based revote, if Sarvis was off the ballot, would have been a 52–48 McAuliffe win.

Writing in The Federalist, Sean Davis concluded:

Sarvis’ presence in the race may actually have helped Cuccinelli. Without Sarvis, McAuliffe’s vote share increases by 4.2 percent, while Cuccinelli’s share only increases by 2.7 percent. On net, McAuliffe’s margin of victory would have increased by nearly 1.6 percent without Sarvis in the race.

The hardball attacks on Sarvis by various Cuccinelli supporters across Virginia — accusing him of being a LINO (“Libertarian in Name Only”) and attributing to Sarvis positions he did not hold, such as supporting Medicaid expansion and attaching GPS devices on cars to track mileage — may actually have led potential Sarvis voters to stay home or vote for their second choice (Terry McAuliffe) rather than to vote for Cuccinelli.

If that’s the case, Cuccinelli’s anti-Sarvis strategy badly backfired. If he had been open to including Sarvis (who was polling anywhere from 8 to 13 percent in October) in the debates, as McAuliffe was, Cuccinelli could have provided an opportunity for Sarvis to highlight his progressive positions supporting gay marriage and legalizing marijuana, drawing even more votes from McAuliffe on Election Day.

Any Republican strategists doing a post mortem on the 2013 governor’s race will have to take this into account.

I will be discussing this topic on television Sunday morning with Coy Barefoot on Inside Charlottesville, which airs at 11:30 a.m. on CBS19 (WCAV-TV), immediately following Face the Nation.

Update: I just came across the cross-tabs for CNN’s exit polls for the 2013 Virginia gubernatorial election, which show that more than 71 percent of Sarvis voters would have voted for McAuliffe if Robert Sarvis had not been in the race, compared to about 28 percent voting for Cuccinelli under the same circumstances.