A defining exchange in the first presidential debate opened with Republican Sen. John McCain's incredulous condemnation of the threat by Democrat Sen. Barack Obama to launch unilateral military strikes against terrorist outposts in Pakistan, a U.S. ally.
"Now, you don't do that. You don't say that out loud," Mr. McCain said. "If you have to do things, you have to do things, and you work with the Pakistani government."
Mr. Obama responded that he never talked about "attacking Pakistan" and challenged Mr. McCain to disagree with his policy on hitting terrorist safe havens in Pakistan's rugged mountains bordering Afghanistan.
"If the United States has al Qaeda, [Osama] bin Laden, top-level lieutenants in our sights, and Pakistan is unable or unwilling to act, then we should take them out," he said. "Now, I think that's the right strategy. I think that's the right policy."
Mr. McCain, of Arizona, did not disagree with the policy but with saying it "out loud," a breach of decorum he considers a dangerous rookie mistake on the international stage. However, he defended a similar off-the-cuff remark on the campaign trail by Republican vice-presidential nominee Gov. Sarah Palin that the United States should "absolutely" launch cross-border attacks into Pakistan.
A similar division separates them on talks with leaders of rogue nations, which Mr. Obama supports as a way of breaking long-standing diplomatic impasses and Mr. McCain insists send the wrong message by validating tyrannical regimes. However, both candidates say lower-level negotiations can pave the way for presidential talks.
These disagreements underscore the "toned and nuanced differences" in diplomatic styles that separate Mr. McCain and Mr. Obama on foreign affairs, said international relations professor Steven David, director of the National Security Studies program at Johns Hopkins University.
"When you look at some of the big issues - whether it is Israel, Iran or the spread of nuclear weapons - it is not clear to me that the differences are that overwhelming, and the differences that exist tend to be exaggerated," Mr. David said. "You've got to base your judgment more on what you believe they will do than on what they say they will do."
The candidates both vow strong support of Israel and pledge to contain - or reverse - the proliferation of nuclear weapons technology.
Both advocate leading an international diplomatic effort pressing Iran to abandon nuclear weapons development, though Mr. Obama stresses offering political incentives such as membership in the World Trade Organization while Mr. McCain wants a tough U.S. military posture in the region to reinforce the message.
Mr. McCain and Mr. Obama do have opposing views of the U.S. missile defense system program. Mr. McCain supports early deployment of a ballistic missile shield in Europe and elsewhere. Mr. Obama takes the Democratic Party stance that no funds should be spent acquiring or deploying a system until it is proved to work.
They also differ widely on trade issues, with Mr. Obama calling to renegotiate the North American Free Trade Agreement and opposing trade deals backed by Mr. McCain with South Korea and Colombia.
However, even on the divisive issue of the Iraq war, Mr. Obama's position has edged closer to that of his rival. He still advocates a 16-month pullout timetable for U.S. troops, which Mr. McCain vehemently opposes, but the Illinois senator echoes Mr. McCain's credo that force levels ultimately must be decided based on conditions on the ground.
The two campaigns say the candidates' positions on the wars highlight their superior judgment: Mr. Obama's judgment in opposing from the outset the costly conflict that Mr. McCain supported and Mr. McCain's judgment in backing the successful 2007 surge of U.S. troops, which Mr. Obama opposed.
Mr. McCain's rhetoric remains focused on victory in Iraq; Mr. Obama calls for making victory in the Afghanistan war the top priority.
Debating at the University of Mississippi, Mr. Obama said the lesson of the Iraq war was not to shrink from armed conflict but to "use our military wisely, and we did not use our military wisely in Iraq."
"We've spent over $600 billion so far, soon to be a trillion. We have lost over 4,000 lives," he said. "We have seen 30,000 wounded. And most importantly from a strategic, national security perspective, al Qaeda is resurgent [in Afghanistan], stronger now than at any time since 2001. We took our eye off the ball."
Mr. McCain said the next president will not decide whether to go to war in Iraq but will "decide how we leave, when we leave and what we leave behind."
"Senator Obama said the surge could not work, said it would increase sectarian violence, said it was doomed to failure," he said. "Recently on a television program, he said it exceeded our wildest expectations. But yet, after conceding that, he still says that he would oppose the surge if he had to decide that again today."
Peter Beinart, senior fellow for U.S. foreign policy at the nonpartisan Council on Foreign Relations, said the two stances on Iraq reflect disparate world views that shape the tenor, if not the substance, of their foreign policies.
"McCain sees the world more as an arena of inherent conflict, while I think Obama sees more of an opportunity for cooperation," said Mr. Beinart, author of "The Good Fight: Why Liberals - and Only Liberals - Can Win the War on Terror and Make America Great Again."
"You also see it on the different tone they set on Russia. Mr. McCain's rhetoric has more of a containment quality about it," he said, referring to the U.S. Cold War policy on the Soviet Union.
Mr. McCain took a more hard-line position than President Bush when Russian tanks rolled into Georgia in August, accusing Moscow of attempting to topple Georgian President Mikhail Saakashvili and warning Russian President Dmitry Medvedev and Prime Minister Vladimir Putin of the "severe, long-term negative consequences that their government's actions will have for Russia's relationship with the U.S. and Europe,"
Mr. Obama, who was vacationing in Hawaii at the time, initially avoided direct criticism of Russia and called for a political solution on both sides. He eventually called for Russia to withdraw and for review of Russia's application to the World Trade Organization.
He said the United States should "convene other international forums to condemn this aggression, to call for an immediate halt to the violence, and to review multilateral and bilateral arrangements with Russia, including Russia's interest in joining the World Trade Organization. ... The relationship between Russia and the West is long and complicated. There have been many turning points, for good and for ill. This is another turning point."