Midterm elections are rarely happy events for incumbents, and the Democrats were aware of this, having picked off so many congressional seats in traditionally Republican territory in 2006 and 2008.

The election was seen as a referendum on President Barack Obama and the Democratic agenda, according to interviews with voters that were conducted for the National Election Pool, a consortium of television networks and The Associated Press, with a wide majority of the electorate saying the country was seriously off track. Nearly nine in 10 voters said they were worried about the economy and about four in 10 said their family’s situation had worsened in the last two years.

The last two years Democrats watched hope and change ebb into disappointment, even anger, for many Americans — during the health-care battle, the auto and Wall Street bailouts and the battles over how to fix the economy.

Exit polls showed the economy was the chief concern of voters, with more than half listing it as the country’s main problem. No other issue came close including concerns about immigration, health care, Afghanistan, taxes, the deficit or even dysfunction in Washington politics.

That dissatisfaction helped Republicans pick up governorships and congressional seats across the country.

Democratic control of the Senate was assured just before midnight Tuesday, when Sen. Barbara Boxer of California was declared the winner in her bitter contest against former Hewlett-Packard chief executive Carly Fiorina.

That means that, for the first time in decades, the House changed hands without the Senate following suit.

Although the House shifted to Republican control, Democrats were able to protect several Senate seats — in West Virginia, Delaware and elsewhere — that had been in danger of slipping away. That was just enough to preserve a legislative redoubt from which President Obama can continue to assert his agenda.

The dozens of Democratic congressmen who lost to Republicans in the economically struggling Midwest include Representative Ike Skelton, the Missouri Democrat who heads the Armed Services Committee.

Republicans, who returned to power in the House after four years of Democratic control, also swept away veteran incumbents in Indiana, Florida, Texas and Virginia. And they defeated freshmen Democratic lawmakers, too, as they staked their claim to the House majority two years into the Obama administration.

Democrats did have a few bright spots, such as in California where former governor and current Attorney General Jerry Brown won despite his GOP rival, former eBay chief executive Meg Whitman, spending more than $140 million of her own money on her campaign.

Many voters who said they believed Obama’s polices would hurt the country in the long run, rather than help it, said they supported the Tea Party movement, which has backed insurgent candidates all across the country.

Marco Rubio, a Tea Party favorite, easily won the Florida Senate race, one of the most closely watched in the country. Tea Party candidate Rand Paul, won in Kentucky and is seen as positioning himself as the Tea Party movement’s standard-bearer on Capitol Hill.

But in Delaware, Christine O’Donnell's insurgent campaign was plagued by missteps, including a pro-O’Donnell commercial in which she told voters: “I am not a witch. I am you.” She lost to a previously little-known Democrat, Chris Coons.

Candidates affiliated with the Tea Party — Republican state Rep. Nikki Haley, endorsed in the GOP primary by former Alaska Gov. Sarah Palin won — becoming the first Indian-American governor in the history of South Carolina by defeating Democrat Vincent Sheheen.

In the Senate, the effect of the Tea Party was exactly what establishment Republicans had feared: although Tea Party energy may have helped launch some victories, concerns about Tea Party extremism also cost them what could have been easy gains.

The Tea Party now faces the challenge of channeling the energy it brought to the election into a governing agenda when it has no clear mandate, a stated distaste for the compromises required in legislating and a wary relationship with Republican leaders in Congress.

Tea Partiers are not the first self-styled revolutionaries to storm Capitol Hill, but as with others, what remains to be seen is whether they will change the system, or whether the system will change them.

The outcome makes for one of the most diverse Republican Senate conferences in years — and the potential recipe for gridlock with chastened Democrats.

Obama had warned voters that the election would have “dire consequences” as he nade a last-minute pleas for support, but the electorate instead seemed intent on producing the split government that it has preferred in recent decades.

Maureen Dowd in the Wednesday’s New York Times seem to articulate the frustrations of many Obama supporters: “Even though it was predicted, it was still a shock to see voters humiliate a brilliant and spellbinding young president, who’d had such a Kennedy-like beginning, while electing a lot of conservative nuts and promoting this central-casting congressman… (as) the next Speaker of the House.

“Republicans out-communicated a silver-tongued president who was supposed to be Ronald Reagan’s heir in the communications department," Dowd wrote.

“They were able to persuade a lot of Americans that the couple in the White House was not American enough, not quite ‘normal,’ too Communist, too radical, too Great Society. All that Ivy Leagues chilling had made them think they knew better than average American folks, not to mention the founding fathers.”

After Tuesday’s election, all eyes will be on Obama to see how he handles the losses — with much of his to-do list unchecked and his own re-election campaign looming in two years.

“He may not get very much more of his agenda… but in a way, he’s made his mark, and all he has to do is protect it,” James Ceaser, a political professor at the University of Virginia, told reporters. “His next duty is to protect the change and hope that things turn around…”

Recent history provides two examples of presidents who paid a price for a bad economy in the midterm elections, only to turn around and sail to re-election because of a turnaround in the economy. That happened to President Ronald Reagan in the 1980s and President Bill Clinton in the 1990s.

The midterm elections are not likely to affect a change in the Obama administration’s policies abroad, said Secretary of State Hillary Clinton. “The political winds blow back and forth, but I think you will find that President Obama is a pretty steady captain of the ship,” Clinton said in Malaysia on Tuesday, the sixth stop on her 13-day Asia-Pacific tour. “… He will continue to promote his agenda, which I think is right for America and right for the world.”

But back in Washington, observers generally believe it is hard to know what to expect on a lot of the country’s international and national security issues because they were completely absent from the election campaign.