There are two problems with John McCain's political attacks on Barack Obama's foreign policy. First, on the biggest foreign policy questions of the last eight years, Barack Obama has made the right judgment and John McCain has sided with George Bush in making the wrong one. Second, the failure of the McCain-Bush foreign policy has forced John McCain to change his position, and to embrace the very same Obama approaches that he once attacked.

Just this week, Senator McCain has been forced by events to switch to Barack Obama's position on two fundamental issues: more troops in Afghanistan, and more diplomacy with Iran. On both issues, Obama took stands that weren't politically popular at the time – opposing the war in Iraq as a diversion from the critical mission in Afghanistan, and standing up for direct diplomacy with Iran – while John McCain lined up with George Bush. Time has proven Obama’s judgment right and McCain wrong.

The next shift appears to be Iraq. For months, Senator McCain has called any plan to redeploy our troops from Iraq "surrender" – even though we'd be leaving Iraq to a sovereign Iraqi government. Now, the Bush Administration is embracing the negotiation of troop withdrawals with the Iraqi government – a position that Senator Obama called for last September, and reiterated on Monday in the New York Times. And now, Prime Minister Nouri al-Maliki supports Barack Obama’s timeline, telling Der Speigel that, “Barack Obama is right when he talks about 16 months.”

Afghanistan –

· McCain at the beginning of the week: more of the same

· McCain at the end of the week: more troops

Barack Obama said in 2002 that we had to finish the fight against Osama bin Laden and al Qaeda in Afghanistan instead of invading Iraq. John McCain was George Bush's biggest supporter for a war in Iraq that took our eye off of Afghanistan, arguing that we would be "greeted as liberators"; that democracy would spread across the region; and that we could "muddle through" in Afghanistan. On the most important foreign policy judgment of our generation, Obama got it right and McCain got it wrong.

Since then, our overwhelming focus on Iraq has caused us to shortchange Afghanistan. The result is clear. Osama bin Laden is still at large. Al Qaeda has reconstituted a sanctuary along the Pakistani border. The Taliban is on the offensive. June was the highest casualty month of the war. And Obama's judgment was reaffirmed earlier this month, when Admiral Mullen, chairman of the U.S. Joint Chiefs of Staff, said, "I don't have troops I can reach for, brigades I can reach, to send into Afghanistan until I have a reduced requirement in Iraq."

Barack Obama has consistently called for more troops and resources in Afghanistan. In August of 2007, he called for at least two additional U.S. combat brigades and $1 billion in non-military assistance. Senator McCain continued to march in lockstep with the failed Bush policy, and even argued earlier this year that "Afghanistan is not in trouble because of our diversion to Iraq." This past week, Senator McCain changed his position for political reasons, embracing Obama's call for more troops the day after Obama restated it in a New York Times op-ed, and almost one year after Obama's initial plan. McCain's proposal was complicated by the fact that the McCain campaign couldn't even get its answer straight on whether those troops would come from the U.S. or our NATO allies – leading the Times to wonder "how well formed his ideas are."

SENDING MORE TROOPS TO AFGHANISTAN

Gergen: "In The Last Two Days We've Seen Twice Now The Bush Administration Reverse Itself And Take Positions That Are Much Closer To Obama's," Added "The Greater Danger To Our Troops Right Now Is In Afghanistan. That's What Obama's Been Arguing All Along." David Gergen: "For the last few months, John McCain has had the upper hand in the arguments about foreign policy, as one of the chief architects of a surge that Obama voted against and then it seemed to work. And yet in the last two days we've seen twice now the Bush administration reverse itself and take positions that are much closer to Obama's. Last night we talked about the fact that suddenly the Bush administration had reversed course and was going to begin talking directly to Iran this weekend, and now tonight we're talking about them reversing course and saying we must send more troops into Afghanistan, and Afghanistan is becoming in many ways at least as dangerous as Iraq. You know, last -- in June, there were virtually the same number of American troops who died in Afghanistan as in Iraq, and yet in Iraq we have five times as many troops. So the danger, the greater danger to our troops right now is in Afghanistan. That's what Obama's been arguing all along." [Anderson Cooper, CNN, 7/16/08]

LA Times Columnist: After Years Of Saying Afghanistan Was Not A Threat, McCain Is Now Calling For More Troops There, "Maybe Because Barack Obama Keeps Hammering Away At The Issue." LA Times columnist Rosa Brooks wrote, "Immediately after 9/11, McCain shared the widespread view that the U.S. should go to war in Afghanistan to take out those responsible for the 9/11 attacks. But by late November 2001, he wanted to "move on to the next country." Uh-huh: "Next up, Baghdad!" Of course, we stayed in Afghanistan too, but McCain had gotten tired of it. By April 2003, he said that "nobody in Afghanistan threatens the United States of America," so we could focus instead on the shiny new war in Iraq. "We don't read about [Afghanistan] anymore, because it's succeeded," he explained in October 2005. But Iraq started getting boring too, so now McCain has turned his restless attention back to Afghanistan -- maybe because Barack Obama keeps hammering away at the issue. (Obama, who's been fairly consistent on Afghanistan for six years now, is either the rare politician who doesn't suffer from ADD, or he's smart enough to take his meds.)" [Rosa Brooks Column, LA Times, 7/17/08]

IRAN

· McCain at the beginning of the week: against high-level talks with Iran

· McCain at the end of the week: praised Bush Administration's high-level talks with Iran

Barack Obama has consistently said that our policy of not pursuing direct diplomacy with Iran has failed, and he has made it clear that he favors direct talks with the Iranian regime in order to advance our interests. Senator McCain and President Bush have ridiculed Obama's support for direct diplomacy with the Iranian regime. In his trip to Israel, President Bush took implicit aim at Senator Obama, and suggested his proposals for tough diplomacy constituted "appeasement," while McCain said Obama's approach was "naive" and "shows a lack of experience.

Here is the record of the McCain-Bush approach. Iran has advanced its illicit nuclear program. Iran is now enriching uranium, and has reportedly stockpiled 150 kilos of low enriched uranium. Iran's support for terrorism has increased. Iran’s threats toward Israel have increased. Those are the facts, they cannot be denied. McCain has fully supported this failed policy, while Obama has called for a new direction.

This week the Bush administration finally appeared to recognize that it is reckless refusal to participate in talks with our European allies and the Iranian regime had failed. The Bush Administration shifted its policy, and is sending a top-ranking State Department official to join in nuclear talks across the table from Iran in Geneva Senator McCain, a long-time critic of diplomatic engagement with Iran, now changed his position to Obama's and said that he had "no problem…whatsoever" with this high-level diplomatic engagement with Iran. For the second time in one week, events on the ground forced John McCain to change his position to embrace an Obama position.

TALKS WITH IRAN

Stephanopoulous: "Undersecretary Of State William Burns Will Be Meeting With The Iranians This Weekend As Part Of Their Nuclear Talks," Obama Has "Been Calling For Those Kind Of Talks For A Long Time." George Stephanopoulous said, "Senator McCain has moved more towards Barack Obama's position on Afghanistan, calling for two or three more brigades in Afghanistan which Obama's called for a long time and watch for this, Chris. We just learned today that the Undersecretary of State William Burns will be meeting with the Iranians this weekend as part of their nuclear talks. Watch for the Obama campaign to say this vindicates Barack Obama's position. He's been calling for those kind of talks for a long time." [ABC Good Morning America, 7/16/08]

Gibson: Bush Administration Insisted It Would Not Talk With Iran, But Its New Willingness to Talk "Is Essentially What Barack Obama Has Been Proposing." Charlie Gibson: "The Bush administration, for years, has insisted it would not talk with Iran until Iran suspended its nuclear enrichment program. That policy was reversed today. The State Department said it will send Undersecretary of State William Burns to meet face-to-face with Iran's nuclear negotiator this weekend. So, Martha Raddatz is here to explain what seems like a major turnaround…There are political implications to this because this is essentially what Barack Obama has been proposing, isn't it?" Martha Raddatz said, "It sure sounds like it, Charlie. There's a good quote today, from John Bolton, the former U.N. ambassador. He said this is like getting an Obama administration six months early. The White House says it's very different. But it sure sounds like it's heading in that direction." [ABC World News, 7/16/08]

Bolton Sarcastically Said Bush Shift Toward Talking To Iran "Is The State Department Effort To Insure A Smooth Transition To The Obama Administration." John Bolton said of the Bush Administration's agreeing to talks with Ira, "Even if this is a one time only event in the Bush administration, it legitimizes the Obama administration to do the same thing," he said. "It undercuts McCain, and Republicans on the Hill. This is the State Department effort to insure a smooth transition to the Obama administration." [New York Sun, 7/17/08]

Washington Post: While Bush Administration Opposed US Officials Accompanying Solana To Iran Talks, "Obama Campaign Officials Had Said That One Of The First Steps He Would Take As President Would Be To End The Ban On U.S. Officials Accompanying Solana." "Administration officials have long insisted that U.S. representatives would not join even preliminary discussions with Tehran until it stops enriching uranium -- a distinction that presumptive Democratic presidential nominee Barack Obama has called counterproductive. In June, when Solana traveled to Tehran to present a sweetened offer to Iran to negotiate, the United States pointedly did not join other members of the international coalition in sending a senior official to the meeting. State Department spokesman Sean McCormack said at the time that no U.S. representative would attend unless 'Iran suddenly has a change of tune and says that they will meet the demands of the international community, which are expressed in U.N. Security Council resolutions.' European officials hailed the news that Burns would come to Geneva as a breakthrough, one that sends a clear message to Iran that the international community is interested in negotiating a solution to the nuclear impasse. 'It is a very interesting and important sign by the United States,' one senior European official said last night. Obama campaign officials had said that one of the first steps he would take as president would be to end the ban on U.S. officials accompanying Solana." [Washington Post, 7/15/08]

The Guardian: McCain has "no problem…whatsoever" with high-level talks with Iran. "John McCain, said he had 'no problem . . . whatsoever' with Burns going to the Geneva meeting, but repeated said he would not meet Ahmadinejad. " [The Guardian (London), 7/18/08]

IRAQ

Barack Obama has consistently called for a responsible redeployment of our troops from Iraq so that we can press the Iraqis to take responsibility for their country, restore our military, and finish the fight in Afghanistan. It is in America’s interests to end the Iraq War responsibly, and it is in the interest of the Iraqi people to have a government that reconciles its differences and takes responsibility for the future of Iraq.

John McCain has consistently labeled any plan to remove U.S. troops from Iraq as “surrender.” However, just this week, the White House agreed on a “general time horizon” for the removal of U.S. troops from Iraq. And speaking to Der Spiegel, Prime Minister Maliki said, “Barack Obama is right when he talks about 16 months.” He went on to say, “Artificially prolonging the tenure of US troops in Iraq would cause problems.”

Senator McCain has said that we must leave Iraq when the sovereign government of Iraq wants us to. Now that the White House has shifted closer to Senator Obama’s position on negotiating the redeployment of our troops from Iraq, and the Prime Minister of the sovereign government of Iraq has endorsed Senator Obama’s 16 month timeline, will Senator McCain shift his position on redeploying troops from Iraq? Why does Senator McCain refuse to press the Iraqis to stand up? Why does Senator McCain want to stay in Iraq longer than we need to and longer than the Iraqis want us to? Does Senator McCain think it would be “surrender” to leave Iraq to the Iraqi government?

Council on Foreign Relations, McCain: “I don't see how we could stay when our whole emphasis and policy has been based on turning the Iraqi government over to the Iraqi people” QUESTION: Let me give you a hypothetical, senator. What would or should we do if, in the post-June 30th period, a so-called sovereign Iraqi government asks us to leave, even if we are unhappy about the security situation there? I understand it's a hypothetical, but it's at least possible. McCAIN: Well, if that scenario evolves, then I think it's obvious that we would have to leave because— if it was an elected government of Iraq— and we've been asked to leave other places in the world. If it were an extremist government, then I think we would have other challenges, but I don't see how we could stay when our whole emphasis and policy has been based on turning the Iraqi government over to the Iraqi people. http://www.cfr.org/publication/6973/ {April 22, 2004}

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.

Marc Ambinder is an Atlantic contributing editor. He is also a senior contributor at Defense One, a contributing editor at GQ, and a regular contributor at The Week.