The chequered tale of the Taliban 'boy commander'
When he was barely out of adolescence, Obaidullah Safi was fighting a war in the lawless borderlands of Afghanistan's Kunar province.
Even though he was born in 1992, his story of divided loyalties, betrayals and bounties mirrors those of Afghan power-brokers, commanders and warlords over the centuries.
While his contemporaries were busy chasing girls or playing sport, Obaidullah had the distinction of having fought for - and being imprisoned by - both sides in the Afghan conflict.
He joined the Taliban at 16, waging many fierce battles against Nato-led forces in Afghanistan and Pakistan. Three years later he decided to switch sides and help the government in their war against the Taliban.
When I met him earlier this year, he had been made head of the local police and put in charge of 60 men.
There was a Taliban bounty on his head and he had been informed that the militants "were ready to sacrifice the lives of 50 insurgents" in exchange for his.
But in a further twist to his story, shortly after that interview he was arrested and charged with the murder of an influential tribal elder - the very man who had paid a ransom to free him from his imprisonment by the Taliban years earlier. He denies the charge, saying he has been framed.
A friend in Afghan intelligence arranged for me to meet Obaidullah on a clear day in a house near a remote mountain pass.
After about 45 minutes of waiting in the sweltering heat, a motorbike passed by. The rider had his face and head covered with a scarf, for protection against the dust.
The bike returned after a few moments.
"How are you, Bilal?" the rider said in Pashto as he parked nearby.
Standing only five feet (1.5m) tall but with an athletic physique, Obaidullah looked far older than his 19 years.
"I was studying in grade eight at the local school and dreaming of being an engineer when the Taliban approached me," he said. "My vast knowledge of Kunar's rugged terrain interested them."
Three years ago Kunar was very unstable and the scene of frequent clashes between the Taliban and Nato-led forces.
"Loyalties were divided. Although many people in my village supported the Afghan government, they were fast becoming disillusioned because of a lack of development, poverty and rampant corruption.
"Taliban propaganda was at its peak. And I became its victim," he said.
"When I first met Taliban insurgents, I found them to be credible young men following the path of Sunnah [the recorded words and actions of the Prophet Muhammad]," Obaidullah said. "I was young and raw, and fell in love with their ideology."
Obaidullah was taken to a Taliban camp, given basic training in handling a weapon, and sent to a remote area on the Afghan-Pakistan border to fight.
'Kill or capture'
His skill in battle attracted the attention of the Taliban leadership - in three years he rose through their ranks to become one of their youngest commanders.
Obaidullah says he has fought on both sides of the Afghan-Pakistan border. "Once I raided 12 Pakistani checkposts in a single day," he said.
"With every successful attack on Afghan and Nato forces, I became more and more popular among my fighters," he said.
He even claims to have met the chief of the Pakistani Taliban, Hakimullah Mehsud.
He says that he was eventually put in charge of 250 fighters. According to Afghan intelligence officials in Kunar, his rising popularity among the insurgents was noticed by Nato forces, and his name was soon included in their "kill or capture" list.
But the teenager says he became disillusioned with the "futility" of the insurgency after being imprisoned by the Taliban in 2010 and what he calls their "pretence" that they were safeguarding and furthering Islam.
"In three years, I had begun to understand the true nature of the Taliban's jihad," he said. "I thought they were fighting for Islam. But they were not. They were fighting for themselves or for Pakistan," he said.
Obaidullah says trouble with the Taliban arose when he refused to accept suicide attackers in his group, deeming such a move to be un-Islamic. He also said he had reservations about targeting the local infrastructure.
He was jailed by the Taliban for 47 days in 2010 for being a renegade commander, accused of wrongfully taking ransom money, extortion and working for Afghan intelligence.
"The Taliban's war was only a pretext for destroying Afghanistan," he said.
With nine of his most trusted lieutenants, he decided to swap sides.
During his subsequent interrogation, government officials became aware of his knowledge of Kunar's terrain and his understanding of the Taliban's internal workings, and thought his strengths could be put to use.
A few months later, he was made head of the local police, in charge of 60 men, including the nine insurgents who surrendered with him.
But Obaidullah has a chequered reputation among villagers in the area. One elder in the Shroankaray valley in Khas Kunar said: "We all feared him. He was brave, cruel and if he said he was going to do something, he made sure he did it."
Obaidullah admits that he extorted money from tribal elders and rich traders, but insists the money went to senior Taliban leaders.
"I didn't make money for myself," he says.
Shortly after our interview, in October 2012, Obaidullah was arrested and charged with the murder of the influential tribal elder who paid the $52,000 (£32,000) ransom to free him when he was held by the Taliban two years ago.
Obaidullah flatly denies this charge, but he remains in prison in Asadabad in Kunar and is awaiting a hearing at a military court. If he is found guilty, he could face life in prison or the death penalty.
His career on the front line was relatively short-lived. But Obaidullah's shifting loyalties are just one example of the instability inherent in Afghanistan's borderlands.