Though most voters in both states said in exit polls the election was not a referendum on the Democratic president, the result sends a warning to moderate Democrats nationwide concerned about their reelection chances next year. That could deal a blow to Mr. Obama's ambitious agenda, foremost healthcare reform and energy legislation, amid continuing high unemployment.

In one bright spot for Democrats, the party's candidate won the special election for the House seat in New York's 23rd district – a takeover of a historically Republican seat. It was a wild contest, marked by dissension within the national GOP, as conservatives effectively drove the Republican nominee out of the race for not being conservative enough.

In the long run, Democrats might actually have preferred that the Conservative candidate win, as it would have emboldened conservatives nationally to take on moderate Republicans in districts and states where the moderate may be a better fit. But for the short term, the victory of Democrat Bill Owens in NY-23 provided the one bright spot in a gloomy night for the party.

New York Mayor Michael Bloomberg's unexpectedly narrow win for reelection to a third term, in which he spent $100 million of his own money, highlighted another theme of the evening: It was a bad night for incumbents. That warning shot, just a year after Obama won on a promise of change that favored Democratic candidates, puts incumbent candidates of both parties on notice for next year. But Democrats, who currently enjoy big majorities in the House and Senate, have more to lose.

The GOP sweep of statewide races in Virginia, in which the governor, lieutenant governor, and attorney general all went to Republicans, marked a sharp turn from a year ago. Then, Barack Obama put the state in the Democratic column for the first time in a presidential race since 1964. On Tuesday, Republican Bob McDonnell beat Democrat Creigh Deeds by a whopping 18 percentage points, returning the state to GOP control for the first time in eight years. The Republicans also picked up seats in the state legislature.

In New Jersey, incumbent Democratic Gov. Jon Corzine lost his bid for reelection against Republican Chris Christie, in a heavily Democratic state. Mr. Christie, a former US attorney, won with a plurality 49 percent of the vote, versus 45 percent for Governor Corzine and 6 percent for independent Chris Daggett. Voters in that race told exit pollsters that the economy and jobs were the No. 1 issue, followed by high property taxes. But in a sign that Mr. Christie has his work cut out for him, a majority of voters said they did not believe any of the three candidates had a workable plan to lower property taxes. New Jersey has the highest property taxes in the country.

In general, the economic anxieties of New Jersey and Virginia voters showed Obama and the Democrats that they could face a stiff headwind next November. Though important indicators show an economy on the mend, unemployment approaching 10 percent – and likely to get worse before it gets better – dominates public consciousness.

"Vast economic discontent marked the mood of Tuesday's off-year voters, portending potential trouble for incumbents generally and Democrats in particular in 2010," wrote ABC News pollster Gary Langer in an exit poll analysis. "Still, the gubernatorial elections in Virginia and New Jersey looked less like a referendum on Barack Obama than a reflection of their own candidates and issues."

In Virginia, 48 percent of voters said they approve of Obama's job performance. In New Jersey, that number is 57 percent. Nationally, Obama's job approval rating averages just above 50 percent in major polls.

But Obama's personal popularity was not enough to carry either Democrat across the finish line in either state. In New Jersey, in particular, Obama put his own prestige on the line by making last-minute appearances with Corzine, to no avail. In Virginia, Mr. Deeds distanced himself from Obama at times, which dampened enthusiasm among voters who had flooded polling places a year ago to support Obama. Most tellingly, Deeds lost even in suburban Fairfax County, an increasingly Democratic stronghold. Deeds was generally seen as a weak candidate, who failed to articulate a clear, positive message for himself. McDonnell, in contrast, was well-spoken and disciplined, and did not allow the surfacing of his 20-year-old master's thesis laying out ultraconservative social views to distract from his core economic message.

McDonnell effectively put to rest concerns about his views on women, by running TV ads featuring women who have worked for him over the years speaking positively about him. He also highlighted one of his daughters, who was a platoon leader in Iraq. In his master's thesis, he said women who work outside the home harm families. He also laid out conservative views on abortion and birth control, but did not highlight his social positions in the campaign.

Already, analysts are touting McDonnell's campaign style, demeanor, and message as a winning model for Republican candidates. In a party desperate for appealing, fresh faces who could play well on the national stage, McDonnell is a figure to watch. If he succeeds as governor in what is now a swing state, watch for Republicans to start mentioning him as possible presidential material – not in 2012, when he will be finishing his term, but in 2016. Virginia governors are allowed to serve only one term.