Rep. John Boehner (R) of Ohio celebrates the GOP's victory that changes the balance of power in Congress and will likely elevate him to speaker of the House, during an election night gathering in Washington, on Nov. 2.

Washington — The Republican Party has swept the Democrats out of power in the House and gained seats in the Senate, sending a strong message of voter discontent to President Obama on the economy.

Republicans scored at least a 60-seat gain in the House, the biggest partisan shift since the Democrats gained 75 House seats in 1948. In the Senate, the Republicans fell short of the 10 they needed to take control, and failed to capture their most-hoped-for quarry: the seat of Senate majority leader Harry Reid (D) of Nevada, who defeated tea partyer Sharron Angle by five percentage points. It is the first time in 80 years that the House has changed hands without the Senate following.

The historic wave that makes Rep. John Boehner (R) of Ohio the expected next speaker of the House also hands Mr. Obama the biggest challenge of his political career. Suddenly, the president has no choice but to work toward his unfulfilled 2008 campaign promise of greater bipartisanship. The alternative is gridlock and the appearance of ineffectiveness. But if Obama concedes too much to the Republicans, he risks losing the support of his Democratic base when he runs for reelection in 2012, as expected.

All eyes will be on Obama Wednesday at 1 p.m. EST, when he holds a press conference in the East Room of the White House. Tuesday night, Obama phoned both Congressman Boehner and Senate Republican leader Mitch McConnell to say he was looking forward to working with them and the Republicans “to find common ground, move the country forward, and get things done for the American people,” according to the White House.

Obama finds himself in straits similar to those of President Clinton in 1994, the last time the Democrats lost their congressional majority. Mr. Clinton adapted, becoming a skilled “triangulator” as he tacked to the political center, and won reelection easily two years later. More important, the economy had improved by 1996. For Obama, a brighter economic picture remains the most significant ingredient needed for reelection, but if he can master the new reality of divided government, Americans will feel more comfortable about handing him four more years.

The key for both parties is that they learn the right lessons from the landslide of 2010. For congressional Democrats, the message is obvious: What you’re doing isn’t working, you’re out. For Republicans, the danger of misreading is greater. Pre-election polls consistently showed that voters were equally unhappy with both parties, and were voting more against the party in power, the Democrats, than for the opposition Republicans.

“We make a great mistake if we believe that tonight, these results are somehow an embrace of the Republican Party,” Senator-elect Rubio said after handily defeating his two opponents. “What they are is a second chance – a second chance for Republicans to be what they said they were going to be, not so long ago.”

It was just four years ago that the Republicans lost their majorities in the House and Senate. Many Republicans felt their own party had lost its way in failing to control spending and the growth of government. Now they have a new opportunity, fueled by the determination of tea party conservatives, to show their partisans what they can do.

By early morning Wednesday, election results were still trickling in. But several points were clear:

Money can’t buy love. Most of the major self-funders, GOP Senate candidates Carly Fiorina of California and Linda McMahon of Connecticut, went down to defeat, as did the mother of all self-funders, California gubernatorial candidate Meg Whitman (R). Ms. Whitman lost to former (and now future) Gov. Jerry Brown (D). Whitman broke all records for self-funding, spending $142 million of her own money. The big exception may be Rick Scott, the Republican former health-care CEO who funneled more than $50 million of his own money into the governor’s race in Florida. The race remained too close to call Wednesday morning.

Tea party upsets in Senate primaries did prove costly to the GOP. Nevada’s Sharron Angle and Delaware’s Christine O’Donnell, both tea party favorites, failed to win seats for the GOP that more conventional nominees would likely have won. In Kentucky, where tea partyer Rand Paul won his Senate race, that seat was expected to stay in Republican hands anyway.

The Senate tea party caucus may not be all that big. Aside from the losses of Ms. Angle and Ms. O’Donnell, the fate of other tea partyers remained uncertain. The Colorado Senate race, featuring tea partyer Ken Buck (R) against appointed Sen. Michael Bennet (D), the outcome was too close to call. The implosion of the Republican gubernatorial candidate, Dan Maes, who was originally backed by the tea party before it abandoned him, may have hurt GOP turnout. In Alaska, GOP tea party nominee Joe Miller also appeared to be trailing in his intraparty battle royale against write-in candidate Sen. Lisa Murkowski (R), whom he had defeated in the primary. Those two races could take weeks to resolve.

The Democrats weren’t completely hopeless in House races. Democrats beat two Republican incumbents, Rep. Joseph Cao of Louisiana and Charles Djou of Hawaii, both of whom had won the historically Democratic seats in the last two years under quirky circumstances. The Democrats also picked up the seat of Rep. Mike Castle (R) of Delaware, who lost his Senate primary to O’Donnell. But they lost an open House seat in Illinois that they had a good shot at winning, the seat vacated by Rep. Mark Kirk (R), who won President Obama’s old Senate seat Tuesday.

The Republicans won critical governorships. In a year of congressional redistricting, governors' offices become extra-important. So the GOP victory in Ohio and possibly in Florida, two key swing states, took on added significance. The biggest prize of the night, California, changed to Democratic hands, and New York stayed in Democratic hands. Republican Rick Perry, governor of Texas for 10 years, won four more. And Illinois was too close to call.