When Gen. David H. Petraeus took command of the war in Iraq at its low point in 2007, he sent a blunt e-mail to a fellow officer about the task ahead: "We're going to get one last shot at this and we need to make it really count," he wrote. "It's not business as usual."
Petraeus could make the same statement today after being chosen by President Obama to take over in Afghanistan. Once again he is being put in charge of a faltering war by a president desperate to see quick results.
By choosing him, Obama managed to make both a surprise pick to replace Gen. Stanley A. McChrystal -- and the most logical one.
No other officer in the U.S. military is more qualified for the job, or has a better record at counterinsurgency warfare. In Iraq, Petraeus proved he was the right man at the right time. In Afghanistan, though, he will face in some respects an even tougher challenge, with even less promising prospects for something resembling victory.
High profile military operations in the Taliban heartland are struggling. Casualties are rising. Weariness is growing in both the U.S. and Afghanistan over a conflict that is now longer than the Vietnam War.
Perhaps no one appreciates the differences between Afghanistan and Iraq better than Petraeus.
This month, in testimony to Congress, he said that, though overall levels of violence were higher in Iraq, stabilizing Afghanistan "would be harder than Iraq due to the lack of human capital, damage after 30 years of war, illiteracy, lack of infrastructure and so on."
But Petraeus has rarely failed at anything in a three-decade Army career that has seen him become perhaps the most influential soldier-scholar of his generation. In that sense, taking over day-to-day command in Afghanistan is a risky step for Petraeus, who was one of the few senior officers to emerge from the war in Iraq with his reputation enhanced.
Petraeus, 57, has always reveled in his reputation as a gung-ho airborne soldier, someone willing to take on the hardest assignments.
A hyper-competitive fitness fanatic who graduated from West Point in 1974, Petraeus rose through the ranks by outworking his peers and attaching himself to powerful mentors who helped him secure the right jobs, and came to rely on his efficiency and intellectual gifts.
Two decades before the Army found itself bogged down against an apparently intractable insurgency in Iraq, Petraeus wrote a prescient doctoral dissertation during a two-year sabbatical at Princeton University. He warned that the Army needed to rebuild its counterinsurgency capabilities instead of focusing exclusively on preparing for conventional combat.
Petraeus had never served in combat before the invasion of Iraq, a fact that led his many detractors within the Army to question whether he had risen more by connections than talent. He silenced those critics in Iraq, although even Petraeus suffered setbacks in his early assignments. He led the 101st Airborne Division in the initial invasion and then was sent to Mosul, where he had early -- but temporary -- success at containing the insurgency. Later, he had mixed results leading the U.S. effort to equip and train the Iraqi army and police.
In the depths of the Iraq war, Petraeus helped develop the principles of counterinsurgency that he later put into practice after taking over in Baghdad.
He ordered U.S. troops to abandon large bases for smaller combat outposts, where they could better protect Iraqis from insurgent attacks. He proved adept at forging relationships with Iraqi leaders as well as with the U.S. ambassador in Baghdad, Ryan Crocker.
Perhaps most importantly, he embraced the so-called Sunni Awakening, a movement by Iraq's Sunni tribes to set up local defense units to fight the insurgency. Petraeus nurtured the trend by pressuring the Shiite-dominated Iraqi government to pay the units, which helped turn the tide in Iraq in 2007.
He served alongside McChrystal, who was widely praised for the operation that tracked down and killed the head of Al Qaeda in Iraq, Abu Musab Zarqawi.
Since 2008, he has been in charge of U.S. Central Command, which gave him responsibility for overseeing all U.S. military operations in a vast area covering most of the Middle East and South Asia. In that job, he was McChrystal's immediate superior and deeply involved in crafting the strategy that McChrystal has been pursuing, including its emphasis on protecting Afghans and building up the country's government institutions.
But the blueprint Petraeus developed in Iraq is only partially applicable to Afghanistan, and those aspects already are being implemented in many respects.
U.S. troops are already focusing on protecting the population, a trend Petraeus is likely to continue. He will probably focus on improving relations with mercurial Afghan President Hamid Karzai and with his civilian counterpart, U.S. Ambassador Karl Eikenberry. And an effort to encourage Taliban fighters to reconcile with the government is likely to be expanded.