A newly re-elected President Barack Obama will once again deal with a divided Congress as Democrats handily retained control of the U.S.­ Senate, while Republicans kept their solid majority in the House of Representatives.

Republicans were dealt a bitter blow Tuesday by the Democrats, who had more seats to defend and were once seen as vulnerable in the Senate. But two Republican candidates in Missouri and Indiana who had made damaging comments about rape and abortion were both defeated and an incumbent Republican fell in liberal Massachusetts. Republicans also lost a seat in Maine, where an independent who is expected to caucus with the Democrats won, while picking up a Democratic-held seat in Nebraska.

More than $2 billion was spent on the nasty fight for Congress. All 435 House seats were on the ballot, and Republicans retained control there, though Democrats made a few gains. That means Obama will have difficulty passing any ambitious pieces of legislation in his second term.

With almost 90 percent of the 435 House races called by The Associated Press, Republicans had won 227 seats and were leading in nine more. For a majority in the chamber, a party must control 218 seats. Democrats had won 178 seats and were leading in 19 others. That means the party mix in the new House will resemble the current one, which Republicans control by 240-190, with five vacancies.

Only a dozen or so Senate races out of the 33 on the ballot Tuesday were seen as competitive, and almost all of those that were called Tuesday … in Wisconsin, Virginia, Connecticut, Missouri, Ohio, Pennsylvania, New Mexico and Florida … went the Democrats' way. Democrats were assured of retaining or even increasing their 53-47 advantage in the Senate.

Control of the Senate at the very least gives Democrats a firewall against Republican attempts to overturn Obama's signature legislative achievement, his health care reform law, before it is fully implemented in 2014. Republicans had promised to repeal it.

Democrats began the year in a precarious position, defending 23 Senate seats and losing several retiring veterans in Republican-leaning states, all while voter discontent lingered over the sluggish economy and Obama's health care law. But the Democrats fielded some strong candidates, and Republican prospects were undermined by some candidates who proved to be too conservative and by the surprise retirement of Sen. Olympia Snowe in Maine.

Snowe, a moderate, voiced her frustration with the gridlocked Congress when she announced her retirement earlier this year. Independent Angus King, a former governor, won a three-way race to replace her.

King has vowed to be a bridge between the parties and has not said whether he would caucus with the Democrats or Republicans. However, he was expected to side with the Democrats after Republican groups spent hundreds of thousands of dollars on ads attacking him.

Republicans will be left with only a few Senate seats in the Northeast. In a marquee race in Massachusetts, Republican Sen. Scott Brown, who managed to win the seat once held by the late Sen. Edward M. Kennedy, was defeated by Democrat Elizabeth Warren, a favorite among liberals for her work as a consumer advocate.

Congress consistently rates low in public opinion surveys, but incumbents still tend to get re-elected. They benefit from a system that gives them huge financial advantages in their re-election bids, and enjoy support from voters who tend to favor their own lawmakers even if they dislike Congress overall.

Many incumbents in the House were also helped by the once-a-decade redrawing of district boundaries, which has just been completed.

After the last of the Senate races is decided, moderates from both parties in Maine, Connecticut, Nebraska, North Dakota, Virginia, Indiana and Massachusetts will be gone, and another in Montana could lose.

One new moderate will be in Indiana, where Democratic congressman Joe Donnelly won in a state carried by Republican presidential candidate Mitt Romney. Donnelly replaces moderate veteran senator Dick Lugar, who had been expected to easily win re-election before losing a Republican primary to state Treasurer Richard Mourdock, a darling of the anti-tax, limited government tea party movement. Mourdock came under withering criticism after saying in a debate that when pregnancy results from rape, it is "something God intended."

In Missouri, another state won by Romney, Sen. Claire McCaskill had been considered the most vulnerable Democratic incumbent, but she defeated another tea party-backed candidate, congressman Todd Akin, who won the Republican primary. Akin was disowned by Republican leaders, including Romney, after he remarked in August that women's bodies have ways of avoiding pregnancy in cases of what he called "legitimate rape."

Two Democrats senators who rode a Democratic wave to the Senate in 2006 were elected to second terms: Sherrod Brown in Ohio and Bob Casey in Pennsylvania.

In Virginia, Tim Kaine, a former governor and Democratic national party chairman, won a costly, close race against former Republican senator and Governor George Allen after Democratic Sen. Jim Webb decided not to seek re-election.

In the tight race in Wisconsin, Democratic congresswoman Tammy Baldwin prevailed in a close race with former Gov. Tommy Thompson and will become the first openly gay U.S.­senator.

In Connecticut, Democratic congressman Chris Murphy won the seat being vacated by retiring independent Joe Lieberman, the Democratic vice presidential candidate in 2000. Republicans had once hoped that the race would be won by Linda McMahon, the former head of World Wrestling Entertainment who spent more than $42 million of her own fortune in the race.

Some favorites of the tea party movement did well. Republican Ted Cruz, the son of a Cuban-born father, won the Senate race in Texas, while Deb Fischer won in Nebraska.

In the Southwest, Arizona congressman Jeff Flake won a tough race to capture a seat being vacated by a Republican. In Nevada, Republican Sen. Dean Heller turned back a strong challenge from Democratic congresswoman Shelley Berkley.

Senate races were still undecided early Wednesday in two conservative western states, Montana and North Dakota. Republicans hope congressman Denny Rehberg will defeat Sen. Jon Tester, who won a close race during the Democratic wave election of 2006. In North Dakota, Republican congressman Rick Berg was the slight favorite to defeat former state attorney general Heidi Heitkamp for the seat held by retiring Democratic Sen. Kent Conrad.

Democratic Senate Majority Leader Harry Reid and Republican House Speaker John Boehner were likely to remain leaders of their chambers.

In the Senate, Democrats would remain nowhere near the 60-vote supermajority needed to easily pass legislation under Senate rules.

"Now that the election is over, it's time to put politics aside and work together to find solutions," said Reid.

Senate Minority Leader Mitch McConnell said the voters have not endorsed the "failures or excesses of the president's first term," but rather have given him more time to finish the job.

"To the extent he wants to move to the political center, which is where the work gets done in a divided government, we'll be there to meet him half way," McConnell said.