Image caption Many doubt Afghan forces will be able to withstand the Taliban after 2014

Nato has invested hundreds of billions of dollars over the past 10 years trying to raise a modern army for Afghanistan and to rebuild the country's infrastructure.

But if a leaked classified report prepared by the alliance is to believed, all this will go to waste soon after foreign combat forces withdraw in 2014.

The latest in a series of leaks suggests that Nato is much more worried about the course of the war than it lets on in public.

Nato has tried to play down the importance of the report by calling it a "compilation of opinions expressed by Taliban detainees", but it highlights many failures in the decade-long war in Afghanistan.

Image caption The report comes at a sensitive time in Pakistan-Nato relations Senior Taliban representatives... maintain residences in the immediate vicinity of ISI headquarters Nato report Nato report excerpts

The harsh reality is that an increasing number of Afghans are turning to the Taliban, having grown mistrustful of Nato and Afghan forces.

In remote parts of the country where the government rules only on paper, the Taliban are often preferred.

"Americans are like Kuchi nomads," a tribal elder from the south-east once told me. "They come with their tents for some time and before you know them, they leave."

Taliban courts

People have little choice but to support the Taliban in many areas, given the power of the militants.

But widespread corruption in the government and a culture of impunity - where senior bureaucrats or those with connections to them easily escape punishment even for serious crimes like murder - are seen as reasons for people moving closer to the Taliban.

In Kunduz in the north, for instance, several militia commanders working for the government have been accused of extortion, robbery and rape, but not one has ever been tried.

Locals say corruption is rampant even in the judiciary and they have no option but to turn to shadowy Taliban judges to resolve disputes.

One Kabul man I spoke to, Jamshid, a fruit vendor in his 30s, compared the judicial system of the Karzai administration with the desert courts of the Taliban.

"The Taliban courts were swift and strict," he said with admiration.

"A thief would be given the death sentence after a short trial. But under Mr Karzai's rule, it will take a century to prove a thief guilty - and even then there is no guarantee that he will be punished."

Image caption Villagers often prefer the Taliban to "corrupt" Afghan authorities, the report alleges

The country's poor literacy rate and the Taliban's psychological war in many districts is believed to have helped the insurgents to win the hearts of the Afghan population.

Taliban songs, videos and ringtones play on people's emotions.

Taliban leader Mullah Omar has launched his own style of counter-insurgency, and a shadow Taliban administration of sorts is in place in many areas.

Taliban officials do the rounds in villages, districts and valleys collecting taxes and dispensing their version of justice.

I know of several cases where Taliban officials have been fired because people have complained about them - many people see this as a more responsive system than the actual government where such action is rare.

And family loyalties run deep. People from the same village or district as a Taliban fighter will never hand him over to Nato or the Afghan government.

Many families have members working on both sides, some for Afghan forces, others for the Taliban - this is seen as a form of local insurance policy. When villagers hear US President Barack Obama or Vice-President Joe Biden discussing withdrawal in 2014, the Taliban come and say, look Nato is leaving, but we will be here.

Please don't mind because you [Afghan government officials] have helped the mujahideen and you are our friends Taliban radio broadcast

The Taliban's reach is thought to extend right into parts of the government.

When I was in Sarkano district in the eastern province of Kunar, I could hear the Taliban presenter on Radio Voice of Sharia FM: "This is a message for apostate employees of the Afghan government. But not to some of our friends in the government - they know who they are."

Serious threat

Senior officials have told me some government members think the Taliban might return.

"So, they tell the Taliban, 'look we have sympathy with you'," one of the officials said.

"Then the Taliban tell these officials to prove their support. Sometimes, they ask these officials to help carry a fighter, a suicide attacker, or to help with weapons and access."

Another reason for locals turning away from the elected government is its failure to restore or maintain order in areas vacated by Western forces. Afghan security forces, grappling with high illiteracy rates, desertion, drug addiction and Taliban infiltration, have failed to instil confidence in the people.

There have even been several reports of Afghan police selling their weapons to militants.

While Afghan officials admit there are problems in the army and police - on whom the country's future security depends - they say there is no systemic failure.

"The reality is that they sell their bullets and weapons in the market to the highest bidder and that sometimes includes Taliban or other insurgent groups," said one senior Afghan security official in Kabul.

Pakistan is crucial

The leak also puts Afghan President Hamid Karzai in a very difficult position.

He has been trying to repair ties with Afghanistan's not-so-friendly neighbour, Pakistan, which denies sheltering the militants. The report's claims that Pakistani security services are helping the Taliban will do nothing to help his efforts.

Mr Karzai has told his confidants on several occasions that a peace dialogue with the Taliban will succeed only when it has the backing of Pakistan.

"If you have a hundred channels to talk to the Taliban through, and Pakistan is not on board, all of these channels will get closed, but if you have a small number of channels to contact Taliban through, along with Pakistan's approval, it will surely take you somewhere," one senior aide to the president told the BBC.

The leaked document seriously undermines Nato and Afghan government claims over the years that the Taliban have lost their punch.

On the contrary, the Taliban remain a more serious threat than ever to peace and stability in Afghanistan.