Senator, you're no Jack Kennedy. Oh, wait-- actually, you are.

In 1960, John F. Kennedy attacked the incumbent Republican administration for allowing the Soviet Union to open up a "missile gap" over the United States. The gap turned out not to exist. But it put the young, inexperienced Massachusetts senator on the political offensive and positioned him to the right of his more experienced Republican foe on the central foreign policy question of the day.

Barack Obama has pulled off the same feat in this election, with an unintentional assist from John McCain. Since September 11, 2001, the threat of Al Qaeda and Islamic radicalism has dominated the foreign policy debate, and, on this question, Republicans have dominated Democrats, just as they did through much of the cold war. Obama may be winning primarily due to the economy and the unpopularity of President Bush, but the more surprising and historically significant thing about this election is that he has managed to stake out the more hawkish ground on fighting Al Qaeda.

How did the GOP lose its most potent and unassailable political asset? It goes back to July 2007, when The New York Times reported that, in 2005, the Bush administration had aborted a mission to capture senior Al Qaeda members in Pakistan, to the frustration of many intelligence officials and members of the Special Operations Forces. A month later, Obama gave a foreign policy speech in which he lambasted the administration for a "terrible mistake to fail to act." Obama warned, "If we have actionable intelligence about high-value terrorist targets and President Musharraf won't act, we will."

Obama's threat received little attention until he had established himself as the all-but-inevitable Democratic nominee. McCain, seeking to define his opponent as a foreign policy naif, began warning that America could not "risk the confused leadership of an inexperienced candidate who once suggested bombing our ally, Pakistan." In reality, Obama had advocated not bombs but special forces operations. McCain saw it is an opportunity to cast Obama as a total ignoramus--the fool doesn't even know Pakistan is one of the good guys!

Senior editor Jonathan Chait discusses this column with TNR editor Frank Foer:

The issue would barely have made a ripple in the campaign had not one audience member at the second presidential debate asked the candidates if they would violate Pakistani sovereignty to pursue Al Qaeda. Obama replied, "If we have Osama bin Laden in our sights and the Pakistani government is unable or unwilling to take them out, then I think that we have to act, and we will take them out. We will kill bin Laden, we will crush Al Qaeda. That has to be our biggest national security priority."

McCain could have agreed with Obama. But he seemed determined to play the part of the foreign policy graybeard correcting the arrogant young upstart. So McCain, while noting parenthetically that he, too, would use troops "where necessary," insisted that the key thing was to work with Pakistan. McCain fairly sneered, "He said he wants to announce that he's going to attack Pakistan. Remarkable."

While there's no precise way to measure how this specific exchange went over with the public, some things are clear. Opinion polls showed that debate viewers deemed Obama the winner. Thirty-four percent told a USA Today/Gallup poll that the debate made them view Obama more favorably, while only 12 percent said they viewed him less favorably. The reaction to McCain was diametrical: Twelve percent saw him more favorably, 33 percent less favorably. What's more, a ABC News/Washington Post poll following the debate found that McCain's advantage on handling terrorism, once 20 points, had dwindled to six.

Not long ago, it was simply assumed that terrorism would be a massive political advantage for Republican presidential candidates for the foreseeable future. That any Republican, especially an experienced war hero, would find himself outflanked on this question by a Democrat--let alone an inexperienced Democrat with a Muslim-sounding name--would have defied imagination.

Like the missile gap controversy, the Pakistan dispute is largely a political show. (McCain has admitted he'd use force to capture Al Qaeda agents in Pakistan, rendering his complaints against Obama farcical.) But it does stand for a genuine schism between the two parties and their ideological tendencies. Conservatives are fixated on the role of states. "Terrorists cannot operate without the succor and protection of governments," wrote Charles Krauthammer not long after September 11, 2001. "The planet is divided into countries. Unless terrorists want to camp in Antarctica, they must live in sovereign states." President Bush declared that, henceforth, all nations would be deemed with us or against us, and those in the latter camp would be invaded.

This line of thinking led directly to the invasion of Iraq. And, during most of the Bush years, conservatives viewed their greater willingness to fight conventional wars in the name of fighting radical Islam as a sign of their seriousness about the threat. Radical Islamic terrorism was an existential threat, not merely a criminal nuisance. The fundamental divide between right and left, as they saw it, was that only their side understood that this was a War.

But, over the last couple of years, less and less of this bluster has emanated from the right. Al Qaeda has fled to a semi-autonomous region that defies easy with-us-or-against-us categorization. Conservatives have reverted to their default fixation with states. McCain called Russia's invasion of Georgia "the first probably serious crisis internationally since the end of the cold war." What about September 11, Islamofascism--you know, the transcendent cause of our time? McCain and conservatives still care about that. But their focus has already turned to Russia, Iran, China, and other nasty governments across the globe.

You can care about both radical Islam and the traditional great power struggle, and both McCain and Obama do. But you can only have one first priority. Obama (rightly, I think) considers the prospect of terrorists acquiring a nuclear weapon the highest potential threat. Thus he places more emphasis on securing Russia's cooperation in locking down fissile material and pressuring Iran to stop its nuclear program, while McCain gives more priority to confronting and isolating Russia.

Fortunately for Obama, Americans still consider Osama bin Laden enemy number one. If McCain wanted to run against Russia, he should have run for president 48 years ago.

Jonathan Chait is a senior editor at The New Republic.

This article originally ran in the November 5, 2008, issue of the magazine.