NEW HAMPSHIRE -- Front-runner Mitt Romney came under attack Sunday in the second Republican presidential debate in New Hampshire in two days, with rivals saying he would be unable to defeat President Barack Obama.

In heated exchanges with former House Speaker Newt Gingrich and former Pennsylvania Sen. Rick Santorum, Romney defended his record when he was governor in neighboring Massachusetts and said he is a consensus-builder who would be able to withstand the rigors of a "billion-dollar" campaign by the president.

The Sunday debate broadcast by NBC came two days before New Hampshire's first-in-the-nation primary, with Romney ahead in the polls and looking to launch a momentum-building run after his narrow victory in last week's Iowa caucuses.

Asked about Romney's electability in a race against Obama, Gingrich called him a product of a liberal-leaning Massachusetts political culture who would "have a very hard time getting elected."

He also accused Romney of speaking "pious baloney" by claiming he left politics in the 1990s to try other things.

"You've been running consistently for years and years and years," Gingrich said. "Just level with the American people."

Santorum, meanwhile, asked why did Romney "bail out" on the Massachusetts people by not running for re-election for governor, a comment that caused Romney to laugh out loud.

"We want someone when the time gets tough, and it will in this election, we want someone who will stand up for conservative principles," Santorum said.

Romney responded that New Hampshire voters can't be fooled about the record of a governor in the state next door, and said only someone with his experience in the business sector outside of Washington politics could defeat Obama.

While proclaiming that a career in politics "stinks," Romney also said he would fight for a second term if elected president when challenged on that point by Santorum.

Former Utah Gov. Jon Huntsman, meanwhile, went after Romney for comments at Saturday night's debate criticizing Huntsman's service as U.S. ambassador to China under Obama.

Huntsman said he was serving his country, whether a Democratic or Republican president, to which Romney responded by questioning how someone seeking to lead the Republican Party could have promoted the policies of the Obama administration.

"This nation is divided ... because of attitudes like that," Huntsman shot back, prompting applause.

Other candidates also faced criticism in the NBC News/Facebook debate on NBC's "Meet the Press" program.

Rep. Ron Paul of Texas, who has placed among the top three candidates in recent polls as well as in the Iowa caucuses, was asked about his legislative record, with shows only one of his bills passed during his more than 20 years in Congress.

"That demonstrates how out of touch the U.S. government and U.S. Congress is with the American people," Paul answered, arguing that his failed proposals represented legislation favored by the public but rejected by politicians.

Santorum followed by saying that Paul was incapable of working with others in the legislative process, calling him "out of the margins."

Texas Gov. Rick Perry sought to distinguish himself from his rivals, saying his calls for a balanced budget amendment, term limits and a part-time Congress went against the wishes of career Republican politicians.

"There's a bunch of people standing up here that say they're conservative, but their records don't follow up on that," said Perry, who maintains hope of becoming the conservative choice despite an inability to recover from a drop in support after weak performances in previous debates.