"Rather than fight a war that does not need to be fought, we need to start fighting the battles that need to be won on the central front against Al Qaeda, in Afghanistan and Pakistan," he said in a March speech on foreign policy.
But now he faces the tougher challenge of turning the page, which will require him to bring the unfinished war in Afghanistan -- and the attendant skirmishes in Pakistan -- to a successful conclusion.
To that end, Obama is preparing to implement recommendations from his military advisors (all holdovers from the George W. Bush administration) for an escalation that could double the number of U.S. troops on the ground and keep them fighting for five years or more.
So does the Obama approach represent a dramatic shift in foreign policy beyond just tone? Not yet, but it's heading in that direction.
Obama's decision to commit more troops is in line with the Bush administration's plan for an Iraq-like surge in Afghanistan. But the new administration's strategy also includes some striking new elements.
One change is a decision to set lower goals and to be candid about that. Another is to shift U.S. and allied efforts from the ineffective and corrupt central government in Kabul to provincial and local governments instead, even if some of them are dominated by warlords. A third is a greater focus on Pakistan in its own right, not merely as an adjunct to the Afghanistan war -- because a descent into chaos by nuclear-armed Pakistan would be even worse for U.S. security than a collapse in Kabul.
Get breaking news alerts delivered to your mobile phone. Text BREAKING to 52669. You will receive up to 30 msgs/mo. Msg&data rates may apply. Text HELP for help. Text STOP to cancel.
Robert M. Gates, the no-nonsense Defense secretary who has seamlessly achieved the improbable transition from working for Bush to working for Obama, made the shift to lower goals clear when he appeared before congressional committees last week.
"Our primary goal is to prevent Afghanistan from being used as a base for terrorists and extremists to attack the United States and our allies," he said. "If we set ourselves the objective of creating some sort of Central Asian Valhalla over there, we will lose, because nobody in the world has that kind of time, patience and money."
That's a sea change from the Bush administration, which staked out vastly ambitious goals -- bringing democracy to the Muslim world, redrawing the map of the Middle East -- only to discover that its reach exceeded its grasp.
Bush's second inaugural address in 2005 was about what he called his "freedom agenda," assertively promoting democracy around the globe. Obama's inaugural address last month didn't have the word democracy in it; instead, it promised the Muslim world "mutual respect" from an America filled with "humility and restraint."
The second change, focusing on local and provincial governments in Afghanistan, is an outgrowth of strategy reviews by Gen. David H. Petraeus, the commander of U.S. forces in the area, and other military officers. The idea is to make deals with provincial tribal leaders who appear willing and able to run reasonably effective, uncorrupt regimes, even if they are not always perfect. Obama has already edged away from Bush's embrace of President Hamid Karzai, both because Karzai has been a disappointment (Obama slammed him publicly last year for "not [getting] out of the bunker") and because the administration wants to appear neutral in Afghanistan's presidential election this fall.
The third change, a greater focus on Pakistan, has been building for several years, but Obama appears ready to take it to a new level. The clearest sign was his appointment of Richard C. Holbrooke, the Hulk Hogan of U.S. diplomats, as a special envoy for both Afghanistan and Pakistan: two countries, one crisis.
The administration is likely to seek a modest increase in military aid to Pakistan's army and security forces, which the United States has been pressing to be more aggressive against Islamist extremists in the country's lawless west. It will almost certainly include a tripling of economic aid to Pakistan's civilian government -- a pledge of $15 billion over 10 years that was initially proposed (as luck would have it) by then-Sen. Joe Biden and endorsed by Obama and Secretary of State Hillary Rodham Clinton when they were still in the Senate.
The U.S. relationship with Pakistan will continue to be rocky. After hearing from U.S. intelligence officials who say the attacks have succeeded in disrupting Al Qaeda, Obama has decided to continue Predator strikes in the border region of Pakistan. But the Pakistani army continues to rebuff American proposals for closer cooperation in counterinsurgency operations
The Obama administration's approach can be summed up as practical rather than idealistic. Obama may sometimes have sounded like a dreamer on the campaign trail, but there's nothing dreamy about his foreign policy so far.
There's a simple reason for all that pragmatism: Fixing Afghanistan and Pakistan is going to be harder than fixing Iraq, and the penalties for failure are greater. As Obama said, that really is Al Qaeda on the ground down there. The goal -- denying extremists and terrorists a safe base -- is more modest than bringing democracy to the region, but crucially important.
The downside for Obama is that his presidency, launched with a promise of peace in Iraq, will spend much of its time waging a grueling war in Afghanistan. If all goes well, conditions will improve -- but only after a difficult passage when they are likely to be far worse, with increased violence and casualties.
The conflict will still be underway when the president runs for reelection in 2012. It will be his war then, not his opponent's. But he knew that came with the job.