(CNN) -- A Republican Party left for dead by many in the wake of recent Democratic landslides sprang back to life with wins in hotly contested races for governor in Virginia and New Jersey.
But the victories Tuesday were tempered by the loss of a congressional seat in upstate New York held by the GOP since the Civil War.
In Virginia, 55-year-old former state Attorney General Bob McDonnell became the first Republican to win the state's highest office in 12 years. Republicans also won races for Virginia's lieutenant governor and attorney general.
In New Jersey, former federal prosecutor Chris Christie, 47, ousted first-term Democratic Gov. Jon Corzine. Christie is the first Republican to win the top office in the heavily Democratic state in 12 years.
Corzine became first New Jersey governor to lose a re-election bid since 1993, when then-Gov. Jim Florio, a Democrat, lost to GOP challenger Christine Todd Whitman.
The two gubernatorial contests were considered by some analysts to be the first major referendums on President Obama's young administration. Republican leaders, demoralized after landslide defeats in 2006 and 2008, were hoping wins in Virginia and New Jersey could help fuel a nationwide Republican resurgence.
They were buoyed by a huge swing of independent voters to the Republican column.
"The real heroes who brought home the victory are the Republicans and independents and, yes, even Democrats who spoke up against an incredibly arrogant government in Washington that has put our country, our freedoms and our economy at risk with unprecedented spending," said Michael Steele, chairman of the Republican National Committee.
The outcomes, however, also followed recent trends. Since 1989, the party winning the White House has always gone on to lose the gubernatorial races in both states the following year.
A battle for a vacant Republican U.S. House seat worked against the GOP in upstate New York. The contest to fill the seat sparked a vicious internal fight between party conservatives and moderates. The struggle was viewed as a proxy for a national struggle between activists arguing Republicans slipped by betraying conservative values and officials warning a rightward move would further alienate an increasingly independent-minded electorate.
The split resulted in the election of Bill Owens, the first Democratic congressman from that region since 1872.
In New York, voters re-elected independent Mayor Michael Bloomberg. The billionaire is believed to have spent well over $100 million of his own money in his quest for a third term, shattering the record for personal spending in any American campaign.
The fight for control of New York's City Hall was one of 380 mayoral races across the country, including contests in Atlanta, Georgia; Boston, Massachusetts; Detroit, Michigan; Houston, Texas; and Seattle, Washington. Democratic incumbents won re-election in Boston and Detroit, but runoffs will be required in Atlanta and Houston as no candidate got 50 percent of the vote. Seattle's contest was too close to call Wednesday morning.
Voters in Charlotte, North Carolina, meanwhile, elected the city's first Democratic mayor in three decades.
In Maine, voters overturned a recently enacted law legalizing same-sex marriage, while across the country in Washington, initial returns indicated that voters were upholding a law granting same-sex domestic partners the same rights as heterosexual married couples.
It was the two races for governor, however, that appeared to attract the most interest at the White House. Obama personally campaigned for the Democratic gubernatorial nominee in both states.
White House spokesman Robert Gibbs said Wednesday that Obama phoned both losing Democratic candidates Tuesday night and intended to call the winning candidates Wednesday to offer congratulations.
Gibbs downplayed any national significance in the results, saying, "It's hard to pick national trends out of local elections."
In both Virginia and New Jersey, a plurality of voters cited the economy as their top concern, according to exit polls. Majorities in both states said Obama's job performance was not a factor in their vote.
In Virginia, McDonnell beat Democratic nominee Creigh Deeds, a state senator from the rural western part of the state, by 21 points among critical independent voters. Last year, Obama edged out GOP presidential nominee John McCain by one point among Virginia independents.
"I pledge to you, over the next four years, action and results," McDonnell told a gleeful audience at his victory party in Richmond. "We will leave Virginia better than we found it," he said, invoking the old Boy Scout adage.
African-Americans, as expected, voted overwhelmingly for Deeds. But their total share of the vote dropped from 20 percent from last year, when Obama topped the ballot, to 16 percent.
McDonnell benefited from a Virginia electorate that, according to the exit poll, was slightly more conservative Tuesday than it was in 2008. Conservatives also were more unified in their support for McDonnell than they were for former McCain.
McDonnell is a staunch conservative but stressed bipartisan solutions to problems relating to job growth and transportation. Deeds sought to peel social moderates and political independents away from McDonnell in part by highlighting McDonnell's graduate school thesis in which the Republican was critical of homosexuals and women in the workplace.
The attacks appeared to backfire on Deeds. Almost two of every three voters said Deeds attacked McDonnell unfairly; those voters broke for McDonnell by a 21-point margin.
McDonnell's expected victory is in keeping with Virginia's tradition of backing candidates from the party that most recently lost the White House. Republican George Allen was elected in 1993, one year after Bill Clinton won the presidency. Democrat Mark Warner won in 2001, a year after George W. Bush's first presidential victory.
In 2008, Obama became the first Democratic presidential nominee to carry an increasingly diverse Virginia in more than four decades. Fewer than one in five voters on Tuesday, however, said their vote was meant to express support for the president. Almost one in four said their vote was meant to express opposition to Obama.
Farther north in New Jersey, Corzine had pulled even in the final surveys before Election Day with the help of a virtual 2-to-1 spending advantage. Many analysts believed that independent candidate Chris Daggett, a socially moderate former Republican, was digging into Christie's support.
Obama, who carried New Jersey by almost 16 points in 2008, campaigned for Corzine three times, most recently Sunday. The president's help, however, was not enough to save Corzine, who was saddled with burden of seeking re-election in the midst of a steep economic downturn.
Almost one-third of New Jersey voters cited the economy as their top concern in early exit polls, with another 25 percent citing the state's high property taxes. One in five voters said their top concern was the state's struggle with corruption.
Independent voters broke even more heavily for Christie in New Jersey than for McDonnell in Virginia. Corzine was able to keep the race somewhat close, however, due to New Jersey's political landscape. New Jersey voters were both more Democratic and more liberal than Virginia voters.
Last year, the president also managed to carry New York's sprawling 23rd congressional district, a traditional GOP stronghold running along the Canadian border. The area has sent Republican representatives to Congress since Union Gen. Ulysses S. Grant occupied the White House. But this year it was the scene of a GOP civil war when local GOP leaders chose moderate state assemblywoman Dede Scozzafava as their nominee to replace nine-term Rep. John McHugh, who resigned to become secretary of the Army.
The decision to pick Scozzafava sparked a revolt among conservatives. They instead backed Doug Hoffman, an accountant, who ran on the state's Conservative Party line.
Republican leaders were fractured by the choice. Former House Speaker Newt Gingrich backed Scozzafava. Gingrich's one-time deputy, former House Majority Leader Dick Armey, backed Hoffman.
Scozzafava eventually dropped out and backed Democratic nominee Owens.
The victory by Owens may bolster the belief among other Republican leaders that a continuing grass-roots effort to defeat moderate officeholders in party primaries is accelerating a GOP decline in the Northeast and elsewhere.
CNN's Peter Hamby and Paul Steinhauser contributed to this report.