A deal with the Taliban is the only way out In an army of 150,000 US and Nato soldiers in Afghanistan, one rogue solider who massacres 16 civilians, including nine children, does not necessarily mean that the discipline and morale of the whole force is breaking down. However, when the spate of recent incidents is put together - US soldiers burning copies of the Koran, footage apparently showing US marines urinating on bodies of dead Taliban fighters and a series of accidental killings of civilians during US attacks on the Taliban - the situation looks far more grim. There can be no doubt that the western forces in Afghanistan are facing a crisis of confidence, across the Muslim world and also in their home countries. The Afghan people are exhausted by a war that has gone on in one form or other since 1979, when most US soldiers now in Afghanistan were not even born. Increasing numbers of Afghans would agree with what the Taliban have been arguing for almost a decade: that the western presence in Afghanistan is prolonging the war, causing misery and bloodshed. The hundreds of civilians killed already this year across the country are almost forgotten now in the aftermath of the killing of children by a farengi, or foreigner. Moreover, faced with an increasingly corrupt and incompetent government, Afghans are seeing fewer improvements on the ground. So-called "nation building" has ground to a halt, simple justice and rule of law is unobtainable and a third of the population is suffering from malnutrition. The people blame not just the Americans but equally Hamid Karzai and his inner circle, which gives him conflicting and contradictory advice, leading him to flip and flop on policy issues. The Afghan president's desire to seek a strategic partnership agreement with the US is becoming more and more unacceptable to the Afghan people. At the same time he also wants to make peace with the Taliban, but they have no desire for a pact with Washington. His dilemma, which he still refuses to understand, is that he can either ask for a long-term US presence or peace with the Taliban, but not both. America is clearly also exhausted by the two wars it has waged in Iraq and Afghanistan - the latter becoming the longest war in US history. Officers and soldiers have done several tours of duty in both countries, while the wars themselves have been virtually ignored at home. Neither war has yielded the dividends that Washington once hoped for. Osama bin Laden may be dead but al-Qaeda's beliefs have spread their net into many more countries since 2001, while the Taliban have proved to be far more resilient than western forces could conceive of a few years ago. Yet the US military high command has been lobbying in Washington, insisting that some kind of victory in Afghanistan is still possible if only President Barack Obama would not withdraw so many troops so soon and if only Congress would keep the funding flowing. US generals have done their best to delay and undermine the still-weak hand played by the State Department in its efforts to get talks with the Taliban going. But now even the Republicans, many of whom have supported the military and condemned Mr Obama for daring to open talks with the Taliban, appear to be at a loss as to how to move forwards in Afghanistan. After the spate of incidents this year, there should be no doubt in Washington that seeking a negotiated settlement to end the war with the Taliban as quickly as possible is the only way out. Mr Obama has to put his weight behind this strategy to ensure an orderly withdrawal and to give the Afghan people the chance of an end to this war. A power-sharing formula with the Taliban, which now appears increasingly unavoidable, and an accord with neighbouring states to limit their interference, will be key. In 1989 it was America and Pakistan who refused to allow a political solution to end the fighting because they wanted not just the Soviets gone but also Moscow's Afghan protégées led by Mohammad Najibullah. Instead he hung on for three years, resulting in a civil war. America cannot again leave Afghanistan with a civil war as its bequest to the Afghans. Washington, and Nato, must seek an end to the war before withdrawing their forces. Despite the tragic death of so many innocent children, this is still possible if there is a concerted diplomatic and political push. The writer is author of several books about Afghanistan, Pakistan and Central Asia, most recently "Descent into Chaos"