Nine months of torture at the hands of Islamic State fighters, in which he buried the decapitated head of a fellow detainee, are written on the gaunt face of Afghan student Mohammed Yousuf.

Just 10 days after he was freed -- not by Afghan or NATO soldiers, but by the once-feared Taliban -- his eyes are still cavernous and sunk, unable to meet anyone else's gaze.

"I once asked them what my sin was," the 23-year-old said, speaking to AFP in the Kabul home of relatives as his uncle sat listening, sobbing quietly nearby.

"I told them I was Sunni... They told me I have accepted this government and I deserved to have my head chopped off."

Yousuf, an ethnic Tajik engineering student, tells of how he held the head of another hostage in his hands.

The government employee was one of three people decapitated right in front of him. "They told him, 'You are against God'."

The man's name was Abdul Fatah. "I myself buried his head" to give him some semblance of dignity, Yousuf said.

Yousuf's story sheds fresh light on the extreme cruelty of the Islamic State group.

The group has made significant gains in Afghanistan, largely boosted by former Taliban cadres and foreign jihadists, while last week's massacre in Paris is testament to both its global reach and the indiscriminate slaughter that Yousuf describes: murder regardless of religion, race or nationality.

Yousuf was kidnapped in the southern province of Ghazni in February, when men carrying Kalashnikovs stopped the bus he was riding from western Herat city, where he was living, to Kabul.

According to him, the kidnappers were from Uzbekistan -- a country which has long exported jihadists abroad.

They told the hostages they wanted to exchange them for comrades who were being held by the government.

Along with 30 or so other people, he was taken by car on a journey that lasted "six or seven hours" to the militants' secluded base, believing every minute that he would be killed.

There, the torture began. "They would kick us, punch us and beat us up with lashes and sticks," he recounted. "They told us to raise our hands and we had to keep them up for five or six hours."

Story continues

The captives were shackled, blindfolded, and half-starved.

"There was little to eat and drink," Yousuf said. "A cup of tea in the morning and a piece of bread, two trays of plain boiled rice in the evening for 15 people.

"They were telling us if the government does not exchange you we will chop off your head. It is not important whether you are Sunni or Shiite. We want to reach our goal."

- Taliban rescue -

Yousuf had heard of what happened last Friday in Paris, when gunmen opened fire on concert-goers and diners, killing 129 people and sending shockwaves through Europe.

The brutality of the slayings did not surprise him.

For him, IS fighters are "nothing but the enemies of mankind".

Despite government claims that it was behind the rescue operation which freed him and seven other hostages on November 10, Yousuf says the Taliban were his saviours.

"There was war for three days and three nights," he said, describing the battle between the Taliban insurgents and the Uzbek fighters claiming to be from Islamic State.

"When the Taliban came and said you are free, still we did not believe it."

The Taliban took them to a house and unchained them, he said. The hostages said they were hungry. "They brought us food, yoghurt, stew, rice, much food."

The militants then handed them over to local elders, Yousuf said.

Observers have described a "charm offensive" launched by the Taliban in recent months as the militants seek to shed their brutal image.

This, according to Michael Kugelman, an analyst at the Woodrow Wilson think tank, would allow them to position themselves as a "not so bad" alternative to the government of Kabul.

"Yes, I am grateful to the Taliban," Yousuf told AFP. "They treated us well."

Ten days on, Yousuf says he is "not good".

Brought to a hospital after his ordeal, he described being paralysed before a bathroom door for half an hour, believing it was closed and someone was hiding behind it.

"When I came back really it was open... My mental situation is not good now," he said.

He does not know what he will do next. But somehow he still dreams of the future, of being an engineer. He hopes to resume his studies, perhaps in the spring.

But not in Herat: he cannot afford to fly, and there is little chance he will go by road.

"I am too afraid."