Last year in Afghanistan, while serving with the British army, I sat on the rooftop of our patrol base in the middle of Sangin, a small town in Helmand province. Surveying the skyline of flat-roofed mud homes and barren hills, I took stock of the situation. We had seized and occupied Sangin a few days previously, wresting control of the town from the Taliban. During our advance an 11-year-old boy was killed in the crossfire, shot in the head accidentally by our allies, the Afghan national army. Despite this we established our base in a local government building, the district centre, and patrolled the bazaar every day. We bought mangos and chatted to the locals - who seemed ambivalent about our presence.

Just below the surface, however, tension simmered. The boy's death made us a threat to the local population. Despite promising development we had nothing to show for all our big talk. Crucially we had no real answers to questions about the future of the all-important poppy, the basis of Sangin's economy. To the locals, we were clumsy, interfering foreigners, whose arrival presaged conflict and the destruction of their livelihood. Days later Sangin exploded into violence, seeing some of the fiercest fighting by British troops since the Korean war, and which continues as I write.

Sadly, many more civilians across Afghanistan have met the same end as the 11-year-old. Recently in Sangin an estimated 21 civilians were killed by bombs dropped from Nato planes after US and British soldiers were ambushed. In the eastern city of Jalalabad in March, US soldiers shot dead 19 civilians in the aftermath of a bomb attack. And yesterday seven policemen were killed by "friendly fire" in an air strike in the eastern province of Nangarhar.

The Jalalabad shootings may yet be deemed a war crime, but civilian deaths are normally tragic accidents. Often outnumbered and outgunned by militia men, the immediate response of Nato troops is to call on overwhelming firepower delivered by artillery, helicopter gunships and jets. The troops aren't wicked, they're just keen on staying alive. But these weapons are blunt-edged and indiscriminate. The price of overwhelming firepower is the death of nearby civilians.

But accidental or not, civilian deaths catastrophically undermine the entire Nato effort, as relatives of the dead, bent on vengeance, flock to the Taliban cause. As Pashtuns, the inhabitants of Helmand hold Badal, the pursuit of revenge, as a central concept of their social code, which is devotedly adhered to. "A Pashtun waited a hundred years for revenge," a local saying goes, "and was pleased with such quick work." Indeed, the Taliban are ruthlessly exploiting this mindset by deliberately engaging Nato troops from villages.

But it was never supposed to be like this. On my arrival in Afghanistan, I was optimistic about being involved in a reconstructive, nation-building endeavour. Our strategy, the Comprehensive Approach, was supposed to provide security, development and governance. The UK army was to guard a secure "inkspot" around Lashkar Gah (Helmand's capital), inside which the Foreign Office and international development department DfID could establish an alternative to opium production and initiate development to improve the lives of ordinary Afghan people, some of the world's poorest. Afghan hearts and minds would be won over, leaving opium traffickers and the last remnants of the Taliban marginalised.

But the Comprehensive Approach was never given a chance. Our occupation of Sangin and other towns across the north of Helmand was a wild digression away from the "inkspot", motivated by haste and beset by ignorance. We acted as the army alone, purely as a military force, without the crucial hearts and minds-winning capabilities DfID and the Foreign Office should have provided. Far from improving Afghan lives, we have committed a terrible military blunder.

Afghans are sick of foreign armies killing their people. Their president, Hamid Karzai, has publicly criticised Nato's methods and warned that "bad consequences" will follow if civilian deaths continue unchecked. The Afghan parliament has called for a halt to Nato military offensives, and for negotiations with Afghan members of the Taliban. In Kabul last month, I met displaced civilians from Helmand province, some of the 80,000 to 115,000 people the UN estimates have lost their homes in the fighting in southern Afghanistan. "Why do British planes kill our people?" they said. I struggled to answer.

The British command in Helmand should heed the president's warning. The Taliban now control 50% of Helmand province. Development is happening nowhere, and opium production has reached record levels. Unless we immediately de-escalate the level of violence and prevent further civilian deaths, all of Helmand will be lost.

In Sangin today the district centre is a battle-scarred fortified position where more than a dozen British troops have been killed fighting from trenches. Soldiers no longer sit on the roof to enjoy the view. The town lies in ruins, with little trace left of the once thriving bazaar. A peaceful, developed Helmand cannot be won by the sword, and the longer we try, the greater the tragedy.

· Leo Docherty served with the British Army in Iraq and Afghanistan. He is the author of Desert of Death: A Soldier's Journey from Iraq to Afghanistan

dochertyleo@hotmail.com