Correction: An earlier version of this article incorrectly referred to an interview with Herman Cain as being on Fox Business News. The name of the cable channel is Fox Business Network. This version has been updated.

Texas Gov. Rick Perry is interviewed on the Fox News Channel in New York, Thursday, Nov. 10, 2011. Perry rearranged his schedule to try to mitigate a disastrous debate moment, in which he could not remember the third federal agency he vowed to abolish. (Richard Drew/AP)

— The Republican presidential campaign makes a stop in this key primary state Saturday for a debate on foreign policy and national security issues.

It could be an especially important moment for businessman Herman Cain and Texas Gov. Rick Perry, both of whom are trying to recover from major blows to their candidacies.

It will be the first debate as a top-tier contender for former House speaker Newt Gingrich who is enjoying a surge in support, according to new polls numbers released Friday.

The campaign has shifted to South Carolina because the state’s Jan. 21 primary is the third contest of the GOP primary race. No candidate is considered a strong favorite here.

And the chances for a campaign-shifting gaffe at this debate seems particularly high, both for Perry and the other candidates. Compared with the 2008 GOP nominee, Sen. John McCain (R-Ariz.), this group of candidates has little experience on national security issues aside from former Utah Gov. Jon Huntsman Jr., who served as U.S. ambassador to China from 2009 to earlier this year.

Perry, perhaps more than any other candidate, needs a strong performance in Spartanburg. The one-time leader in the polls suffered a huge debate setback in Michigan Wednesday after he could only name two of the three government departments he would close if elected president.

According to reports Friday, the Perry campaign has bought almost $1 million worth of advertising time on the Fox News Channel, a reminder that, despite his recent problems, Perry remains a very well-funded candidate.

Walking in a Veterans Day parade here on Friday, Perry smiled when a man shouted “brain freeze man” within earshot of the candidate and a woman asked if he could now recall the departments. (They are Commerce, Education, and Energy.) The governor has spent the past two days repeatedly mocking himself for the gaffe, even as some of his own supporters worry about his ability to recover.

“I forgot a federal agency. . . . it is what it is, it’s behind us,” Perry said in an interview with the Columbia-based the State newspaper on Friday. “Other than forgetting the name of a federal agency, I thought our debate performance and preparation was fine.”

In an interview, a top Perry fundraiser, who did not want to be quoted publicly, said many people who had personally pledged to him that they would donate to Perry’s campaign are now reneging on those commitments.

The dynamics of the race, however, are that even if Perry is fatally wounded, there’s an opening for another candidate to challenge former Massachusetts governor Mitt Romney, who has been in the lead, or tied for it, in the national polls throughout the year but still has not galvanized the party around him. A survey released by CBS News on Friday showed Cain collecting 18 percent of the vote among Republicans, Romney and Gingrich at 15 percent and Perry in fourth place at 8 percent.

A McClatchy-Marist poll also showed a surge for Gingrich, placing him at 19 percent, effectively tied with Cain and just behind Romney after the former speaker languished in single digits for much of the year.

The Gingrich campaign, which was presumed dead after much of his staff quit early this year, has been trying to take advantage of the moment: He will attend an opening of his South Carolina headquarters in Greenville on Saturday before the debate, and he is adding staff in this key state. He also announced a three-day, eight-city tour of Iowa next week.

“The big thing I take from your poll is that this is a wide-open race,” Gingrich said Friday on CBS’s “The Early Show.” He credited his rise in the poll to “the most substantive campaign in modern history.”

The CBS survey showed obvious problems for Cain; 30 percent of voters said the sexual harassment allegations against the former Godfather’s Pizza executive make them less likely to support him.

But Cain has insisted that his campaign has not been hurt. After pledging earlier in the week to take a lie detector test to rebut the allegations, he told Fox Business Network Friday, if “they are willing to take a lie detector test, I’ll take a lie detector test,” referring to his accusers.

The challenges facing Cain and Perry have sharpened a divide within the GOP between its more establishment wing and party activists from outside Washington. Many anti-establishment Republicans have defended Cain and Perry in recent days.

“Rick Perry is in the process of turning this around,” talk show host Rush Limbaugh said Friday. Of Cain, he said “the Herman Cain train keeps on heading down the tracks.”

Speaking to reporters after an event in Mauldin, S.C., on Friday, Romney said he hoped to be one of the finalists for the nomination, and was not sure who else would survive.

“Whether it’s Newt or Rick [Perry] or Rick Santorum or Herman Cain, I can’t tell at this point,” he said. “But again, I’m going to focus on my job and my message.”

The candidates will likely have to go beyond their usual talking points, which are demanding President Obama affirm U.S. support for Israel as intensely as possible and accusing the president of not following the advice of the military on the wars in Iraq and Afghanistan. The White House disputes both criticisms, but Romney aired an ad on the latter on Friday.

He asserted that Obama should have found a way to negotiate a continued troop presence in Iraq, calling the president’s decision to bring all the troops home “tragic.” He also said the administration’s timetable for withdrawing fom Afghanistan is hasty and politically motivated. Speaking with a group of veterans, he criticized Obama’s performance as commander in chief.

“One of the things that I think has been sorely lacking in our nation as we’ve been at war these last many years is a constant reminder to the American people that we are at war and that people are making huge sacrifices,” he said. “Today it’s almost out of sight, out of mind.”

Staff writers Nia-Malika Henderson and Philip Rucker contributed to this report.