WASHINGTON — Republicans inflicted a double blow on President Barack Obama's Democratic Party, winning gubernatorial races in two states that had backed him last year.

The Republican victories Tuesday in Virginia and New Jersey are a setback for Obama as he struggles to overhaul the U.S. health care system, win passage of climate change legislation, and build political support for his handling of the war in Afghanistan.

They could also be ominous for Democrats ahead of next year's midterm elections, when a third of the Senate, all of the House of Representatives and most governorships are on the ballot.

Tuesday's elections are bound to energize Republicans, who lost control of Congress in 2006 and lost the White House last year. It will help them raise money and recruit candidates to prepare for next year's election.

First GOP governor in eight yearsIn Virginia, Bob McDonnell, a former conservative state attorney general, easily defeated R. Creigh Deeds to become the state's first Republican governor in eight years. The state, once a Republican stronghold, had elected Democratic senators in 2006 and 2008. Last year, Obama was the first Democratic presidential candidate to win the state since 1964. McDonnell had about 60 percent of the vote with most precincts reporting.

In the traditionally Democratic state of New Jersey, Republican Chris Christie, a former corruption-busting federal prosecutor, narrowly defeated Gov. Jon Corzine, a billionaire former Wall Street executive, by a margin of 49 percent to 45 percent. Independent candidate Chris Daggett had about 6 percent.

In both states, independent voters who had been crucial to Obama's victory last year voted overwhelmingly for the Republican candidate.

Video: Referendum on Obama?
Democrats took some solace by winning the closely watched special election for a Republican-held vacant seat in the 23rd Congressional District in New York state that highlighted fissures between moderates and conservatives in Republican ranks.

Long before Tuesday's vote, the White House rejected suggestions that the gubernatorial elections would be tantamount to referendums on Obama. Indeed, the votes took place in just two of the 50 U.S. states. Local issues and personalities dominated campaigns.

Still, exit polls showed more than four in 10 voters in Virginia said their view of Obama factored into their choice. Those voters roughly split between expressing support and opposition for the president. The Obama factor was similar in New Jersey, though there were slightly more voters who said the president did not factor into their choice.

Obama campaigned for Corzine, DeedsObama had inserted himself into the races, campaigning for both Corzine and Deeds and appearing in their advertisements. But Obama's popularity has faded some since the early days of the presidency and clearly wasn't strong enough to make a difference in the campaigns.

That point will not be lost on moderate Democrats seeking re-election in conservative districts and states. They may be reluctant to back Obama on issues like climate change and health care if it means antagonizing local voters — especially if Obama lacks the political heft to carry them through the next election.

Even before the first votes were counted Tuesday, there were new signs of trouble for Obama's health care proposal, his top domestic priority. Senate Democratic leader Harry Reid indicated Tuesday that lawmakers might not complete legislation this year. That would miss Obama's deadline and push debate into the politically precarious congressional election year.

Interviews with voters leaving polling stations in both states were filled with reasons for Democrats to be concerned and for Republicans to be optimistic, particularly about independents, who often determine the outcomes of U.S. elections.

Independents played a critical role in Obama's victory last year. But after more than a year of recession, they fled from Democrats in the two states, where the economy trumped all other issues.

Associated Press exit polls showed that nearly a third of voters in Virginia described themselves as independents, and nearly as many in New Jersey did. They preferred McDonnell by almost a 2-1 margin over Deeds in Virginia, and Christie over Corzine by a similar margin.

Last year, independents split between Obama and Republican John McCain in both states.

Difficulties turning out the baseIn both states, the surveys also suggested the Democrats had difficulty turning out their base, including the large numbers of first-time minority and youth voters whom Obama attracted.

But Tuesday's election also offered a warning to Republicans about how internal divisions could undermine their newfound strength. Party infighting cost them what had been a safe congressional seat from upstate New York.

The Republican nominee, Dierdre Scozzafava, withdrew from the special race for the vacant seat after prominent conservatives, including former vice presidential candidate Sarah Palin, opposed her as too moderate and backed a third-party candidate, Conservative Doug Hoffman.

That created an opening for the Democratic candidate, Bill Owens, who had been endorsed by Scozzafava. With 88 percent of the precincts reporting, Owens had 49 percent of the vote to 46 percent for Hoffman. Scozzafava had 6 percent.

In other races Tuesday, voters in the northeastern state of Maine weighed in on same-sex marriage in a closely watched initiative. With about two-thirds of precincts reporting, opponents of same-sex marriage had a slim lead of 52 percent to 48 percent.

A number of cities selected mayors. Billionaire Michael Bloomberg won a third term as New York mayor in a closer-than-expected race against a Democratic challenger who stoked voter resentment over the way the incumbent changed the city's term-limits law so he could stay in office.

With all precincts reporting, Bloomberg defeated city comptroller William Thompson Jr. 51 percent to 46 percent.

Copyright 2009 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

New York City Mayor Michael Bloomberg celebrates on stage after a narrow win over Democratic challenger William Thompson on Nov. 3. This will be Bloomberg's third term as mayor of New York, after he made a controversial move to overturn term limits and greatly outspent Thompson in his campaign.
(Spencer Platt / Getty Images)
ShareBack to slideshow navigation

New York's 23rd Congressional District Democratic candidate Bill Owens delivers his victory speech in Plattsburgh, N.Y., early Nov. 4. In a surprise, the Democrat won a House seat that Republicans had controlled since 1872.
(Mike Groll / AP)
ShareBack to slideshow navigation

Chris Daggett, independent candidate for New Jersey governor, right, shares a moment with his daughter Justine after voting in Basking Ridge. Daggett, who showed strength in early polling, ended with around 6 percent of the vote.
(Mj Schear / AP)
ShareBack to slideshow navigation

Leland Varner casts his vote at the Grange Hall, in Nimishillen Twp near Louisville, Ohio. According to local media, turnout was high in the off-year election. The most controversial issue on the ballot was an amendment approving the establishment of casinos in the state, which was approved by the electorate.
(Scott Heckel / AP)
ShareBack to slideshow navigation

N.Y. Mayor Michael Bloomberg buys an item from a school bake sale after casting his ballot on Tuesday. The mayor spent more than $100 million in a bid to win his third term as mayor.
(Richard Drew / AP)
ShareBack to slideshow navigation

Democratic mayoral candidate Bill Thompson smiles after casting his vote in Harlem. Thompson, who raised only around $6 million, was edged by Michael Bloomberg in a race that was much closer than expected.
(Diane Bondareff / AP)
ShareBack to slideshow navigation

Editor's note:
This image contains graphic content that some viewers may find disturbing.