General David Petraeus has a high reputation but his real abilities are not the ones usually attributed to him. He is, above all, a general with an acute sense of US politics combined with a realization of the importance of understanding the politics of Iraq and Afghanistan.
His great achievement in Iraq was to persuade Americans that they had won the war when, in fact, they were withdrawing with little achieved. He was able to sell the "surge" as a triumph of military tactics when in reality its most important feature was that Sunni insurgents allied themselves with American forces because they were being slaughtered by the Shia.
Some US diplomats are astonished at the willingness of Congress and the US media to accept the Pentagon’s version of what happened and the belief that the same success could be replicated in Afghanistan. One American diplomat said: "I am appalled… It is like going back to pre-Vietnam days, when Americans accepted that what the military said was true."
An important aspect of the Iraq and Afghan wars is the degree to which US foreign policy has been militarized, with the State Department and civilian agencies playing only a limited role. This helps explain the lack of caution shown by General Stanley McChrystal in openly bad-mouthing civilians from President Barack Obama to the US ambassador in Kabul.
I first met General Petraeus in January 2004, when he was commander of the 20,000-strong 101st Airborne Division based in Mosul in northern Iraq. He was one of the few Americans in Iraq who showed any inkling about the ethnic and communal minefield in which the US had landed.
In Baghdad, the US envoy, Paul Bremer, had banned Baath party members from state employment, which meant that thousands of former Iraqi officers were ready recruits for the growing insurgency. General Petraeus was quietly sabotaging official policy. He was getting former officers to turn up in batches and renounce the Baath party and all its works. He made other astute moves. He prevented returning exiles from getting positions of power.
I asked him what would be his most important advice to his successor and he replied that it was "not to align too closely with one ethnic group, political party, tribe, religious group or social element".
This is what will be so difficult to do in Afghanistan. Already, suggestions that the Afghan government should talk to the Taliban is frightening members of the administration in Kabul who are not Pashtun. Last year, General Petraeus gave the impression that the Iraq troop "surge" could be restaged in Afghanistan. But conditions are very different in the Pashtun south and east of Afghanistan, where the arrival of foreign troops generates a powerful local counter reaction.
A problem for General Petraeus is that the Taliban appear to think they are winning and that their own "counter-surge" has been successful. General McChrystal’s heavily publicized takeover of Marjah did not evict them permanently. When the US ambassador, Karl Eikenberry, and US envoy, Richard Holbrooke – both maligned by General McChrystal in the Rolling Stone article – visited Marjah a few days ago their helicopter was shot at and suicide bombers blew themselves up.
In Iraq, General Petraeus was able to take advantage of local political conditions to claim success for a military strategy that was mostly an illusion. In Afghanistan, the problem is not that the Taliban is so strong but that the government is so weak.
PATRICK COCKBURN is the Ihe author of "Muqtada: Muqtada Al-Sadr, the Shia Revival, and the Struggle for Iraq."