The race for the U.S. Republican Party's presidential nomination appears to be tightening in advance of a crucial primary showdown Saturday in South Carolina. The Republican race took a chaotic turn Thursday when one candidate left the race while another fended off allegations from an ex-wife.

The four remaining Republican White House contenders met for another debate in South Carolina late Thursday. While they argued over jobs, health care and leadership, the focus was on personal allegations concerning former House of Representatives speaker Newt Gingrich.

Gingrich denied an allegation made by one of his two ex-wives, Marianne Gingrich, who said he once asked her to accept the fact that he was involved with a woman staff member even though he was still married to her.

"I said to him, ‘Newt, we've been married a long time'. And he said, ‘yes, but you want me all to yourself. Callista doesn't care what I do.' He was asking to have an open marriage and I refused," she told ABC's Nightline program.

Gingrich eventually divorced Marianne and married the woman he was involved with, Callista Bisek, and she now campaigns with him.

Gingrich denied the allegation and responded angrily when CNN moderator John King raised the issue at the beginning of Thursday's debate.

"I think the destructive, vicious, negative nature of much of the news media makes it harder to govern this country," Gingrich replied, "harder to attract decent people to run for public office, and I am appalled that you would begin a presidential debate on a topic like that."

Later in the debate Gingrich said it was imperative that Republicans defeat President Barack Obama in November, calling him "the most dangerous president of our lifetime."

Recent polls show Gingrich is gaining ground on the frontrunner for the Republican nomination, former Massachusetts governor Mitt Romney.

Romney did not directly address Gingrich's personal issues in the debate and kept his focus instead on President Obama's record on the economy.

"Our president said, I think in a very revealing way, that he wants to fundamentally transform America. He's wrong," Romney said. "We need to restore the values that made America the hope of the earth, and I understand those values."

Former Pennsylvania senator Rick Santorum and Texas Congressman Ron Paul also took part in the debate.

Santorum got some good news earlier when it was announced that he actually won the most votes in the Iowa caucuses on January 3, surpassing Mitt Romney's vote total by 34 votes.

Santorum was critical of both Romney and Gingrich in Thursday's debate and said he was the best conservative candidate to take on the president in November.

"I would make the argument that a conviction conservative who has a clear contrast with President Obama on the most important issues of the day is the best person," Santorum said.

Gingrich got a boost earlier in the day when Texas Governor Rick Perry quit the race and endorsed him over the other contenders.

"I believe Newt is a conservative visionary who can transform our country," Perry said. "We have had our differences, which campaigns will inevitably have. And Newt is not perfect, but who among is?"

Analysts say all the upheaval in the Republican race on the eve of the South Carolina primary has made the outcome difficult to predict. Gingrich has been surging in the polls after Romney had an early lead. But the question is whether the revelations from Gingrich's ex-wife will hurt him with religious and social conservative voters who make up a large percentage of South Carolina's Republican electorate.

South Carolina has a strong record in picking eventual Republican Party nominees. Since 1980, the winner of the South Carolina primary has always gone on to win the Republican nomination for president.