Former House Speaker Newt Gingrich (Ga.) won a stunning come-from-behind victory in the South Carolina presidential primary on Saturday, using hard-edged debate performances to vault over former Massachusetts governor Mitt Romney.

Gingrich was leading Romney by 14 points, 41 percent to 27 percent, with 88 percent of precincts reporting. A week before, Romney had a large lead in opinion polls here.

That vast swing in support gave Gingrich a win that will profoundly re-shape a nominating contest that, a week ago, seemed to be effectively over.

“With your help, we are now moving on to Florida and beyond,” Gingrich told supporters on Saturday night. “I think with your help, I will become your nominee.”

Gingrich cast his success as a sign that average Americans are angry at “elites” in New York and Washington, and in the news media particularly. He said he would use his debating skills to challenge President Obama, proposing a series of seven three-hour debates before the general election.

“It’s not that I am a good debater,” Gingrich said. “It is that I articulate the deepest-felt values of the American people.”

The night seemed to validate Gingrich’s new model for a presidential campaign — which held that his own strong debate performances could overcome Romney’s edge in advertising and money.

Here, it finally worked. About two-thirds of South Carolina voters said that the debates — in which Gingrich blistered his opponents and the moderators — were an important factor in their decisions.

Early estimates were that turnout was about 595,000. That would top the previous record turnout, when 573,101 voted in 2000.

For Romney, the loss meant that his claim to be the GOP’s inevitable nominee suddenly looked dubious. Romney had arrived in South Carolina as the apparent winner of the first two GOP contests. He faced an electorate that seemed open to his message that only a Washington outsider could restore free markets and sensible spending.

Then, this week, Romney lost Iowa in a recount. And then, in South Carolina, he was beaten by a man who had been the ultimate Washington insider.

“We’re now three contests into a long primary season. This is a hard fight because there’s so much worth fighting for. We’ve still got a long way to go, and a lot of work to do,” Romney told supporters. He then attacked Gingrich, without naming him, for sharing some of the same attributes as President Obama. “Our party can’t be led to victory by somebody who has also never run a business and never run a state,” Romney said.

Far behind in third place was former Sen. Rick Santorum (Pa.), who took Iowa from Romney by 34 votes. He said afterward that Gingrich “kicked butt.”

“The great narrative of this is that three days ago there was an inevitability in this race. ... I took Iowa, Newt took South Carolina, and it’s game on again,” Santorum said. “I can’t be more excited for the opportunity now to see this campaign go on, and we’re going to have it go on for a long time.”

Rep. Ron Paul (Tex.) was in fourth place.

Exit polls showed just how fast Gingrich’s fortunes had turned. Among voters who said they had made their choice “in the past few days,” Gingrich had a huge advantage, 44 percent to 22 percent. Among those who had made up their minds earlier, Gingrich and Romney were tied.

The polls also showed that Gingrich had beaten Romney, even among voters who cared about Romney’s bedrock fiscal issues. Among voters who thought the economy mattered most, Gingrich was beating Romney by eight percentage points. Among those who thought the federal budget deficit mattered most, Gingrich won by 19 points.

Gingrich’s support cut across demographic fault lines. He led Romney among both Protestants and Catholics, among the married and unmarried, among veterans and non-veterans. Gingrich even won among both men and women — despite new revelations of infidelity leveled against Gingrich this week by his second wife.

Even where Romney did better, the numbers could not have been that heartening. Among voters who described themselves as “moderate or liberal,” 34 percent went for Romney, and only 31 percent for Gingrich.

But Romney will not win this primary contest with the “moderate or liberal” vote.

Across South Carolina on Saturday, voters had said they liked Gingrich’s aggression in debates — believing it would make him the best Republican to take on President Obama in the fall.

“I think Mitt Romney is a good man,” said Harold Wade, 85, leaving a polling place in this picturesque seaside suburb outside Charleston. “But I think we’ve reached a point where we need someone who’s mean.”

That was Gingrich, he said.

“What we need is someone who’s got some brains,” Wade said, explaining his vote for the former speaker. “And we need someone with some guts.”

Other voters said they’d chosen Romney, inspired by his experience as a business executive, and his steady character. They said they’d been unperturbed by Romney’s troubles this week, as the candidate struggled to answer questions about his wealth and the release of his tax returns.

In Mount Pleasant, S.C., Michael and Elizabeth Ricciardone said they had decided long ago to vote for Romney and never wavered.

“It’s okay to be successful in this country. Redistribution of wealth is not in my vocabulary,” Michael Ricciardone said.

The dynamics of the race shifted in the last days before Saturday’s primary, with Gingrich surging after his aggressive performances in two televised debates.

A few weeks ago, in Iowa, Romney’s campaign and supporters had deflated a similar surge by Gingrich — using a series of negative ads to cast the former speaker as an erratic and self-defeating leader. But this time, Romney’s campaign did not attack Gingrich until the last days before the vote.

“I’d like to see what the report was that he provided to Freddie Mac,” Romney said Saturday, renewing an attack on Gingrich for his paid work for the controversial mortgage giant. “I’d like to see what he advised. He said he was an historian and just provided historical information, then he said he told them what they were doing was somehow not going to work. I’d like to see the report.”

It may have come too late.

“It’s kind of difficult this year. Everybody I talk to, they want to ... they want a change from the president we got. They just don’t know which way to go,” said Danny Causey, who runs a neighborhood barbershop in Mount Pleasant, S.C. “Some of the ones they like the best, they think they don’t have a chance.” So Causey sensed a small shift toward Romney, despite all the hoopla for Gingrich.

Even before primary day began, strange things were happening in South Carolina. Just as light becomes distorted the closer it gets to a black hole, so does politics turn odd at the chaotic edge of an important primary.

On Friday night, for example, Romney — either as a sign of personal growth, or of exhaustion — finally located his zany inner comedian. He made a joke about the cheap Naugahyde office chairs that were used in the early days of Staples, the office supply giant that Romney helped launch.

“Killed a lot of Naugas to get these babies!” Romney said, part of an unusually animated stump speech. He was drawing a comparison to the upscale offices of executives at Solyndra, a failed solar-energy company that the Obama administration lent money to.

That joke itself was old enough to vote — in fact, since it originated in the 1960s, it’s old enough to run for president. But still, people laughed.

And on Saturday morning, like high-school rivals looking for a rumble, Romney and Gingrich both promised to show up in the same diner’s parking lot. In a state with 4.6 million people and 30,600 square miles, the two campaigns scheduled appearances at Tommy’s Country Ham House in Greenville, S.C., at 10:45 a.m.

In the end, Romney showed up 45 minutes early and was gone before Gingrich arrived. The former speaker couldn’t resist a little trash-talking: Gingrich emphasized his own Southern roots (and Romney’s Northern ones) by saying the diner offered some “good eatin’ ” and that it didn’t serve New England clam chowder.

“When we win tonight, we will launch the Florida campaign,” Gingrich said. “You start it here today. ... I am the only conservative who has the opportunity to stop a Massachusetts moderate.”

A Gingrich win in South Carolina means that, after three caucuses, there are three winners.

But, in the bigger sense, no winner. Instead of crowning Romney as the inevitable favorite, the South Carolina contest sets up the next primary, in Florida on Jan. 31.

Fahrenthold reported from Washington. Staff reporters Nia-Malika Henderson in Greenville, S.C., and Rosalind S. Helderman in Sullivan’s Island, S.C., contributed to this report.