Kabul:
In late 2008, shortly after he had helped pull Iraq back from the brink of catastrophe, Gen. David H. Petraeus prepared to turn to that other American war.
"I've always said that Afghanistan would be the tougher fight," General Petraeus said at the time.
Now the burden falls to him, at perhaps the decisive moment in President Obama's campaign to reverse the deteriorating situation on the ground here and regain the momentum in this nine-year-old war. In many ways, General Petraeus is being summoned to Afghanistan at a moment similar to the one he faced three years ago in Iraq, when the situation seemed hopeless to a growing number of Americans and their elected representatives as well.
But there is a crucial difference: In Iraq, General Petraeus was called in to reverse a failed strategy put in place by previous commanders. In Afghanistan, General Petraeus was instrumental in developing and executing the strategy in partnership with Gen. Stanley A. McChrystal, who carried it out on the ground. Now General Petraeus will be directly responsible for its success or failure, risking the reputation he built in Iraq.
General Petraeus, 57, brings an extraordinary set of skills to his new job: a Boy Scout's charm, penetrating intelligence and a ferocious will to succeed. At ease with the press and the public, and an adept negotiator, General Petraeus will probably distinguish himself from his predecessor with the political skills that carried him through the most difficult months of the counteroffensive in Iraq known as the surge.
In those months of 2007, when American casualties were the heaviest of the war, General Petraeus not only prosecuted the strategy but also reassured his superiors, including President George W. Bush, in regular videoconferences from Baghdad.
In Iraq, General Petraeus helped turn the tide not just by sending 30,000 more American troops into Baghdad, but also by fostering deals with insurgent leaders who had spent the previous four years killing Americans. As much as the surge, the movement in Iraq known as the Sunni Awakening helped set in motion the remarkable decline in violence there that has largely held to this day.
By helping to pull Iraq back from the edge, General Petraeus won a reputation as a resourceful, unorthodox commander and has since been mentioned as a candidate for president.
But Afghanistan is a very different war in a very different country. Where Iraq is an urban, oil-rich country with an educated middle class, Afghanistan is a shattered state whose social fabric and physical infrastructure has been ruined by three decades of war. In Iraq, the insurgency was in the cities; here, it is spread across the mountains and deserts of the country's forbidding countryside.
Indeed, to prevail in Afghanistan, General Petraeus will need all of his skills -- and a dose of good fortune at least as big as the one he received in Iraq. At the moment, every aspect of the war in Afghanistan is going badly: the military's campaign in the strategic city of Kandahar has met with widespread resistance from the Afghan public; President Hamid Karzai is proving erratic and unpredictable; and the Taliban are resisting more tenaciously than ever.
To turn the tide, General Petraeus will almost certainly continue the counterinsurgency strategy he devised with General McChrystal: protecting Afghan civilians, separating them from insurgents and winning public support. But he will also have to convince his own troops, who are increasingly angry about the restrictions on using firepower imposed to protect civilians.
And General Petraeus will probably also try to employ some of the same novel tactics that worked so well in Iraq. Most notably, he will continue to coax Taliban fighters away from the insurgency with promises of jobs and security. And he may even try to strike deals with senior leaders of the Taliban as well as with the military and intelligence services in Pakistan.
A former aide to General Petraeus in Iraq who is now in Afghanistan put it this way: "The policy is to make everyone feel safer, reconcile with those who are willing and kill the people you need to."
Perhaps General Petraeus's toughest challenge will be to unify a fractious team of senior officials in the Obama administration who hold sharply differing views of how the war in Afghanistan should be fought. As the head of the United States Central Command, which oversees all military forces in the Middle East, General Petraeus has built a close relationship with Secretary of State Hillary Rodham Clinton, as well with Richard C. Holbrooke, the special representative for the region.
While his predecessor, General McChrystal, was on icy terms with the American ambassador here, Karl W. Eikenberry, General Petraeus forged a tight bond with his civilian counterpart during the Iraqi surge, Ambassador Ryan C. Crocker. General Petraeus and Ambassador Eikenberry, a former general himself, are old Army comrades.
The one uncertain point in General Petraeus's political constellation is the most important one, President Obama. General Petraeus had bypassed his own senior leadership to become Mr. Bush's favorite general. Mr. Obama made it clear that General Petraeus would no longer have a direct line to the Oval Office. The general accordingly assumed a lower profile.
For all of his political shrewdness, however, General Petraeus dislikes the rough-and-tumble of Washington. His displeasure reached its peak in September 2007, when, during the Iraqi surge, he and Ambassador Crocker were called to testify before the Senate Foreign Relations Committee. The violence had not yet dropped significantly, and both men were questioned mercilessly. General Petraeus, who suffers from a bad back, gulped Advil during the hearing.
"The most miserable experience of my life," he told a reporter afterward.
General Petraeus prides himself on his athletic prowess. While in Iraq, he usually ran five miles six days a week, often besting the younger captains he took along with him. After the runs usually come a grueling regime of calisthenics; well into his 50s, General Petraeus could do 17 pull-ups. Recently, though, questions have arisen about his health. Last year, he underwent treatment for prostate cancer; he said he was now cured. Only last week, while testifying before a Senate panel, General Petraeus fainted in his chair. He said he was dehydrated.
General Petraeus will take command of the Afghanistan campaign six months into an 18-month-long strategy that will almost certainly have to show significant progress for Mr. Obama to continue. Even before then, in December, Mr. Obama and his advisers will conduct a "strategic assessment" that will serve as a major progress report.
After that, it is anyone's guess what Mr. Obama will do.
Some members of General McChrystal's staff were not so optimistic. When a reporter recently suggested to a senior American officer here that he might, in the end, run out of time, he did not hesitate to answer.
"I think you may be right," the officer said.