State election board results showed McAuliffe, a Democratic fundraiser and close friend of former President Bill Clinton, had 47 percent of the vote to 46 percent for Cuccinelli, Virginia's attorney general, with 93 percent of precincts reporting.

McAuliffe squeaked to a win with a strong showing from wealthy, liberal-leaning Washington suburbs. His victory cements Virginia as a bellwether swing state ahead of midterm congressional elections next year and presidential elections in 2016.

Record amounts of outside money flowed into the campaign as McAuliffe heavily outspent Cuccinelli and national Democratic figures attempted to make the vote a referendum on the Republicans' small-government Tea Party wing.

Libertarian Robert Sarvis, who campaigned on antipathy to the major parties and their candidates, notched 7 percent. It was the best showing by a third-party candidate in the state since 1965.