The Republican presidential candidates clashed repeatedly over foreign policy and national security issues Tuesday night, revealing clear differences on the pace of withdrawal from Afghanistan, aid to Pakistan, the Iranian threat, immigration, and the balance between protecting the homeland and preserving civil liberties.

President Obama came in for sporadic criticism for his handling of foreign policy throughout the debate. But the bulk of the time, beginning with the opening question, was spent on issues that revealed fissures within the Republican Party’s coalition over how to deal with trouble spots around the world.

The debate came at another time of change in the race for the Republican nomination. For the first time, former House speaker Newt Gingrich (Ga.) assumed one of the center positions onstage, an acknowledgment of his sudden rise in the polls. He used his newfound status as the leader in two polls to effectively display his experience in dealing with national security issues.

But an answer on immigration, in which he said he does not think that the nation should deport many of the millions of immigrants who have been in the country illegally for years, could put him at odds with some conservatives in his party — the same issue that caused problems for Texas Gov. Rick Perry earlier this fall. After the debate, Gingrich defended himself against possible criticism, saying he was not advocating an amnesty program.

The tone of the debate, the 11th among the candidates this year, was largely civil, and the session ranged widely on both domestic and international issues, though there was no discussion of the European debt crisis and little attention paid to China. Despite the differences that emerged, the majority of the candidates offered a generally more hawkish view of the world than that enunciated by the Obama administration.

In contrast to some previous debates, Tuesday’s forum is likely to have only a limited impact on the overall race. Former Massachusetts governor Mitt Romney once again delivered a solid performance.

Rep. Ron Paul (Tex.) stood out by disagreeing most significantly with the other candidates. Former Utah governor Jon Huntsman Jr. used the opportunity to take on his rivals, especially Romney.

The debate was held at DAR Constitution Hall in the District and was sponsored by CNN, the Heritage Foundation and the American Enterprise Institute. CNN anchor Wolf Blitzer served as the moderator, with questions from AEI and Heritage scholars. Eight candidates participated. The others were business executive Herman Cain, Rep. Michele Bachmann (Minn.) and former senator Rick Santorum (Pa.).

Romney, Huntsman spar

One of the sharpest exchanges came between Romney and Huntsman over Afghanistan. Romney argued that Obama was moving too rapidly to bring out U.S. troops and said he favors maintaining a substantial presence for several more years.

Asked his view, Huntsman said, “I totally disagree.” He said money that is being spent on the war in Afghanistan could be better used rebuilding the U.S. economy.

“Are you suggesting, Governor, that we just take all our troops out next week or what — what’s your proposal?” Romney replied.

“Did you hear what I just said?” Huntsman responded. “I said we should draw down from 100,000. We don’t need 100,000 troops. We don’t need 100,000 troops in Afghanistan.”

In the past, Romney has said he would hope to bring the troops home as soon as possible, but with the qualifier that he would listen to the views of military commanders.

The candidates fielded several questions about securing U.S. interests in Pakistan, a nuclear state that has harbored terrorists but that has also provided the United States with a steady stream of intelligence on al-

Bachmann and Perry clashed over whether the United States should continue funneling aid to Pakistan, given its role in harboring terrorists. Perry said that he would not send “one penny, period” until Pakistan demonstrates more willingness to cooperate with American interests, but Bachmann, a member of the House intelligence committee, retorted that Perry was “highly naive,” given Pakistan’s possession of nuclear weapons and the threat of terrorists gaining control of them.

Bachmann said Pakistan is “too nuclear to fail,” arguing that the United States must continue a relationship. But she also said: “We need to demand more. The money that we are sending right now is primarily intelligence money to Pakistan. It is helping the United States.”

Gingrich on immigration

When the debate turned to immigration, it produced an answer from Gingrich that will remain a topic of discussion. The former House speaker said that newly arrived illegal immigrants should be expelled.

But for those who have been here for many years, he took a different view, favoring a path to permanent residency, not citizenship.

“If you’ve come here recently, you have no ties to this country, you ought to go home, period,” Gingrich said. “If you’ve been here 25 years and you got three kids and two grandkids, you’ve been paying taxes and obeying the law, you belong to a local church, I don’t think we’re going to separate you from your family, uproot you forcefully and kick you out.”

Bachmann quickly criticized Gingrich for an idea she described as tantamount to amnesty. “If I understood correctly, I think the speaker just said that we would make 11 people — 11 million people who are here illegally now — legal.”

On Iran, Cain said he would consider helping Israel in a military strike against the Iranian regime if he believed that the Israelis had a credible plan that would succeed. Perry called for tough sanctions against the Iranian central bank. “When you sanction the Iranian central bank, that will shut down that economy,” he said.

Gingrich said he could agree with that. “I think it’s a good idea if you’re serious about stopping them having nuclear,” he said. “I mean, I think replacing the regime before they get a nuclear weapon without a war beats replacing the regime with war, which beats allowing them to have a nuclear weapon. Those are your three choices.”

Clash on civil liberties

The debate opened with a clash over the USA Patriot Act and the trade-off between civil liberties and homeland security. Paul called the Patriot Act “unpatriotic.” He said that there is no need to “sacrifice liberty for security” and that the criminal justice system had effectively dealt with Timothy J. McVeigh, who was responsible for the 1995 Oklahoma City bombing.

Gingrich responded: “Timothy McVeigh succeeded. That’s the whole point. Timothy McVeigh killed a lot of Americans. I don’t want a law that says after we lose a major American city, we’re sure going to come and find you. I want a law that says, you try to take out an American city, we’re going to stop you.”

As part of the discussion, Santorum said he would support profiling “radical Muslims” to prevent terrorist attacks. But he was quickly criticized by Paul, who offered: “What if they look like Timothy McVeigh? He was a tough criminal.”

In anticipation of Tuesday’s debate, the Democrats mounted a full-court press to preemptively challenge Romney and the Republicans and to promote the president’s foreign policy record. Polls show that the public gives Obama good marks on foreign policy and terrorism, in contrast to low numbers on the economy and the deficit.

National security adviser Thomas E. Donilon delivered a speech at the Brookings Institution Tuesday in which he contrasted U.S. policy toward Iran before and after Obama came to office.

Three years ago, he said, “Tehran believed, and many in the region believed, that Iran was ascendant.” Today, he argued, Iran’s standing has declined. “Rather than looking to Iran, people in these Arab countries are looking in the opposite direction — towards universal rights, towards democracy,” he said.