"Thank you, South Carolina!" a jubilant Gingrich tweeted to his supporters. He appealed for a flood of donations for the next-up Jan. 31primary. "Help me deliver the knockout punch in Florida. Join our Moneybomb and donate now," said his tweet.
Exit polls showed he led among voters who said their top priority was picking a candidate who could beat President Barack Obama — a group that had preferred Romney in earlier contests in Iowa and New Hampshire.
Romney, the national front-runner until now, was unbowed. He vowed to contest for every vote "in every state" and unleashed a double-barreled attack on Obama and Gingrich.
Referring to Gingrich's criticism of his business experience, Romney said, "When my opponents attack success and free enterprise, they're not only attacking me, they're attacking every person who dreams of a better future. He's attacking you," he told supporters, the closest he came to mentioning the primary winner's name.
Returns from 57 percent of the state's precincts showed Gingrich with 40 percent of the vote to 27 percent for Romney. Former Pennsylvania Sen. Rick Santorum was winning 18 percent, Texas Rep. Ron Paul 13 percent.
As the first Southern primary, South Carolina has been a proving ground for Republican presidential hopefuls in recent years. Since Ronald Reagan in 1980, every Republican contender who won the primary has gone on to capture the party's nomination.
Based on the vote total, Gingrich won at least 15 of the 25 Republican National Convention delegates at stake and none of the other contenders was yet assured of any.
But political momentum was the real prize with the race to pick an opponent to Obama still in its early stages.
Already, Romney and a group that supports him were on the air in Florida with a significant television ad campaign, more than $7 million combined to date.
Aides to the former Massachusetts governor had once dared hope that Florida would seal his nomination — if South Carolina didn't first — but that strategy appeared to vanish along with the once-formidable lead he held in pre-primary polls.
Romney swept into South Carolina 11 days ago as the favorite after being pronounced the winner of the lead-off Iowa caucuses, then cruising to victory in New Hampshire's first-in-the-nation primary.
But in the sometimes-surreal week that followed, he was stripped of his Iowa triumph — GOP officials there now say Santorum narrowly won — while former Utah Gov. Jon Huntsman dropped out and endorsed Romney and Texas Gov. Rick Perry quit and backed Gingrich.
Romney responded awkwardly to questions about releasing his income tax returns, and about his investments in the Cayman Islands. Gingrich, the former speaker of the House, benefited from two well-received debate performances while grappling with allegations by an ex-wife that he had once asked her for an open marriage so he could keep his mistress.
By primary eve, Romney was speculating openly about a lengthy battle for the nomination rather than the quick knockout that had seemed within his grasp only days earlier.
Exit polling showed Gingrich, the former House speaker, leading by a wide margin among the state's heavy population of conservatives, tea party supporters and born-again Christians.
In a state with 9.9 percent unemployment, about 80 percent of all voters said they were very worried about the direction of the economy. Gingrich's edge over Romney among that group tracked the overall totals closely, the former speaker winning 41 percent and the runner-up 27.
The exit poll was conducted for The Associated Press and the television networks by Edison Research as voters left polls at 35 randomly selected sites. The survey involved interviews with 2,381 voters and had a margin of sampling error of plus or minus 4 percentage points.
Santorum vowed to continue, although his weak third place finish could well portend financial difficulty for a campaign that has never been flush with cash. It's a wide-open race. Join the fight" he urged supporters at a rally in Charleston.
Paul had his worst finish of the year, and isn't expected to make a strong effort in Florida. Even so, he said to supporters, "Keep fighting." He has said he intends to focus his efforts on caucus contests in Nevada on Feb. 4 and Missouri several days later.
Santorum, a former Pennsylvania senator, pinned his South Carolina hopes on a heavy turnout in parts of the state with large concentrations of social conservatives, the voters who carried him to his surprisingly strong showing in Iowa.
Paul had a modest campaign presence here after finishing third in Iowa and second in New Hampshire. His call to withdraw U.S. troops from around the world was a tough sell in a state dotted with military installations and home to many veterans.
Romney's stumbles began even before his New Hampshire primary victory, when he told one audience that he had worried earlier in his career about the possibility of being laid off.
He gave a somewhat rambling, noncommittal response in a debate in Myrtle Beach last Monday when asked if he would release his tax returns before the primary. The following day, he told reporters that because most of his earnings come from investments, he paid about 15 percent of his income in taxes, roughly half the rate paid by millions of middle-class wage-earners. A day later, aides confirmed that some of his millions are invested in the Cayman Islands, although they said he did not use the offshore accounts as a tax haven.
Asked again at a debate in North Charleston on Thursday about releasing his taxes, his answer was anything but succinct and the audience appeared to boo.
Gingrich benefited from a shift in strategy that recalled his approach when he briefly soared to the top of the polls in Iowa. At mid-week he began airing a television commercial that dropped all references to Romney and his other rivals, and contended that he was the only Republican who could defeat Obama.
It featured several seconds from the first debate in which the audience cheered as he accused Obama of having put more Americans on food stamps than any other president.
Nor did Gingrich flinch when ex-wife Marianne said in an interview on ABC that he had been unfaithful for years before their divorce in 1999, and asked him for an open marriage.
Asked about the accusation in the opening moments of the second debate of the week, he unleashed an attack on ABC and debate host CNN and accused the "liberal news media" of trying to help Obama by attacking Republicans. His ex-wife's account, he said, was untrue.