Mitt Romney got virtually everything he needed out of the New Hampshire primary Tuesday night. He won a decisive victory that put him in a dominant position to win the Republican presidential nomination, and he will move on to South Carolina with his opposition badly splintered and running out of time to stop him.

The Palmetto State, which has far more evangelical Christians than New Hampshire does, will provide a different test for the former Massachusetts governor. But he will begin that contest in a stronger-than-expected position, based on his success in Iowa and New Hampshire and the disarray among his rivals.

The composition of Romney’s support Tuesday underscored the advantages the front-runner holds. He was the clear winner among self-identified Republicans and among the often-decisive group of Republicans who consider themselves “somewhat conservative.”

He also was the clear choice among the overwhelming majority of voters who cited economic issues as the principal motivator in their decision and among the one-third of the electorate who said that the ability to beat President Obama was the quality they most sought in a nominee.

That combination has been a formula for success in the past, and it is why Romney is so well positioned after only two states have voted. He also has other advantages: His campaign is far better funded than that of any of his rivals, and his infrastructure is much more impressive.

But Romney’s campaign advisers are bracing for what they expect will be the nastiest contest yet. South Carolina has a history of negative politics, and the contest there will be do-or-die for many of his rivals. Former House speaker Newt Gingrich (Ga.) and an independent fundraising group supporting him have already gone on the attack. Romney’s record at Bain Capital and his conservative credentials could face an all-out assault.

The Palmetto State contest has long been considered potentially difficult for Romney, but he could win it in the same way Sen. John McCain (Ariz.) won it four years ago — with just 33 percent of the vote, the result of a crowded field and divided conservative opposition.

Romney will concentrate most on those areas of the state where Republicans are fiscal conservatives first and social conservatives second and hope that Gingrich, former senator Rick Santorum (Pa.) and Texas Gov. Rick Perry compete for votes in those areas dominated by social conservatives.

New Hampshire voters did nothing to answer the question of which candidate is the conservative alternative to Romney. In fact, they further muddied that race in ways that may simply help the former governor.

Instead of rewarding San­torum or Gingrich, who was endorsed by the conservative New Hampshire Union Leader newspaper, Granite State voters gave another boost to the libertarian candidacy of Rep. Ron Paul (Tex.), who remains one of the genuine surprises of the race.

Santorum hoped that his near-victory in the Iowa caucuses on Jan. 3, coupled with a good showing in New Hampshire, would position him in South Carolina as the main Romney challenger. Instead, after an uneven campaign over the past week, he was battling Gingrich for fourth place.

The combined votes that Gingrich and Santorum received would have put them in third place behind Romney and Paul, who was an impressive second-place finisher. South Carolina will be more hospitable for their brand of conservative politics, but they can’t afford to continue to divide that vote if they have any hope of stopping Romney.

Santorum and Gingrich must live with the reality that fourth- and fifth-place finishes in New Hampshire have never proved to be springboards to success elsewhere, and the two will arrive in South Carolina battling each other as much as Romney, along with a weakened Perry.

Paul’s second-place showing — aided by strong support from young voters, independents and those worried most about the federal budget deficit — helped establish him as a force within the party and a candidate with the potential to be a longer-distance runner than some of the others. That, too, is good news for Romney.

Former Utah governor Jon Huntsman Jr. staked everything on New Hampshire but managed only to come in third. He was running 2 to 1 behind Romney. A strong third place or clear second place would have given him some bragging rights and more incentive to go forward, although he vowed Tuesday night to carry his campaign to South Carolina. Given what happened in New Hampshire, it’s doubtful that he has the resources or the message to successfully compete in that primary.

Paul and Huntsman were boosted by a sizable turnout among independent voters. Paul had a slight edge over Romney among independents, who accounted for nearly half of all voters on Tuesday, and Huntsman attracted nearly a quarter of the independent vote. But in closed primaries, where independents are not allowed to vote, Huntsman in particular will be at a major disadvantage.

Early Tuesday, the Romney campaign sent out an e-mail noting that many of the candidate’s rivals have not qualified for full delegate slates in a number of upcoming states. It was the team’s way of saying that if his opponents are looking for a war of attrition to bring him down, he is well prepared and they are not.

If Romney suffered any damage in the week between his dead-heat victory in Iowa and Tuesday’s balloting in the Granite State, it was largely self-inflicted. Through his own statements, he raised questions about his ability to connect with struggling middle-class voters. But those questions may be more worrisome for Romney in a general-election race against Obama.

It was that contest that an energized Romney was looking toward during his victory speech Tuesday night. His address to cheering supporters helped turn the page on two days of defensiveness on his part and gave him a nationally televised platform to fire back at Gingrich by championing free enterprise and daring the former speaker to try to win Republican votes by attacking his record at Bain Capital.

Romney is the first GOP presidential candidate to win Iowa and New Hampshire. The issue over the coming weeks will be whether conservative Republicans can find a way to rally around a single challenger to the former governor. Or will those Republicans who have been lukewarm toward Romney’s candidacy begin to fall in line behind him, giving him the opportunity to effectively wrap up the nomination by the Florida primary on Jan. 31?