By Hugh Sykes
BBC News, Baghdad
The US troop surge played a major role in reducing the Iraqi insurgency
US President Barack Obama's special envoy to Afghanistan and Pakistan, Richard Holbrooke, warned earlier this year that tackling the insurgency in Afghanistan would be much more difficult than in Iraq.
There have been two main lessons learned in Iraq that America might, or might not, apply in Afghanistan.
The surge by an extra 30,000 American troops was essential for reducing the insurgency, and there are still around 140,000 American forces in Iraq.
A key ingredient in stabilising Iraq has been the Sunni tribes who at first fought against the Americans alongside al-Qaeda, but who then changed sides and turned against al-Qaeda, forming the Awakening Movement, or Sons of Iraq.
But security in the Iraqi capital has been achieved at a price. It is more peaceful, but it is not normal.
Baghdad is a city of checkpoints, watchtowers and and concrete blast walls. Would Kabul want to be like that?
Additionally, the Awakening Movement was welcomed and facilitated by the Americans, but not created by them.
The mastermind of the surge, General David Petraeus, has acknowledged that the emergence of the Awakening took him by surprise.
If he hopes to use the Awakening as a successful model for Afghanistan, it needs to come from the grassroots.
Financial incentives may help to lure back Taleban recruits who are not ideologically committed to the Taleban, but the Awakening phenomenon cannot be imposed.
US defence secretary Robert Gates believes that another lesson learned in Iraq is that stable government and economic development can only happen after proper security has been established.
Afghanistan's terrain makes economic progress and security more difficult
An American soldier and civil engineer in Baghdad, Col Brian Dosa, once said: "You can't wait for security before you do real reconstruction. If you do that, security may never come."
Both countries were invaded by nations which many now believe have a duty to establish security and invest in reconstruction.
"America promised the Afghan people they would improve this country and bring us security - it is their responsibility to fix it," an aid worker in Kabul, Mohammed Yussuf, said.
The sentiment was shared by a US sergeant serving in Baghdad.
"We started something, and it has to be fixed before we go home, or we'll be the laughing stock of the world for destroying Iraq and not fixing it," said Sgt Kevin Sabo.
It is much easier to fix mostly flat Iraq than the complex mountains and valleys of Afghanistan.
For the same reason, it is also much easier for Iraqis to develop their economy here themselves.
Transporting everything from satellite dishes and flat-screen TVs, to rice and wheat, is relatively easy.
There are good roads from Syria, Jordan and Kuwait. And there is a flourishing stock exchange.
Afghanistan is landlocked - and most access is across difficult mountain passes where warlords or the Taleban rule.
And there is an irony - in 2003, after the Iraq war, commentators wondered what lessons there were for post-war Iraq that we could learn from Afghanistan.
There are two lessons that apply to both places - without security, no progress. And without long-term military and economic commitment, no security.