French aid worker and amateur photographer Pierre Borghi spent four months in shackles, imprisoned by the Taliban in a hole in the ground. But an opportunity to escape eventually came his way, thanks in part to the weight he had lost on the "Taliban diet".

I was abducted by the Taliban on the evening of Tuesday 27 November.

It had been an ordinary, relaxed day in Kabul - no bombs or gunfire or stress. I had been to the supermarket, bought Chinese noodles for dinner and planned a quiet night in watching a zombie movie.

This was my second week in Afghanistan on my second visit to the country. I was looking for work in the humanitarian or urban planning sectors while I tried to make it as a photographer.

I was walking back from a bar, where I had been debating with other freelancers and friends the safest way was to get around Kabul. Security was on my mind, but the bar was in pretty much the safest area in the city and I was staying a mere 500m away. I didn't think being outside for five or 10 minutes would be such a risk.

That was a miscalculation.

A white Toyota Corolla stopped just a few metres ahead of me. Four guys got out, bearded, dressed in salwar kameez - the traditional Afghan dress - and headed straight for me.

They tried to grab me and take me to the car. When I fought back, one of them took out a gun and told me to stop resisting. I did.

They shoved me into the middle of the back seat, squashing me between their knees, and started driving. We went through all the supposed safety checkpoints. After a while they pulled over, blindfolded me, bound my hands behind my back and put me in the boot of the car, along with one of the kidnappers.

They made it clear that any attempt to make a noise or move would be severely repressed.

Pierre Borghi Pierre Borghi has degrees in sociology and urban planning

Before being abducted, he had worked on projects in Senegal, Bangladesh, South Sudan and Afghanistan

He spoke to Outlook on the BBC World Service Listen to his interview Download the Outlook podcast More from the World Service

Scared as I was, I was switching to a strange survival mode. It's a very conscious process. You start thinking "Oh no - this is actually happening." And then you begin to detach yourself from everything and you try not to panic and to be as rational as possible.

After another few hours of driving, they put me in the first of the two holes in the ground I was to be kept in. It turned out to be the nicer of the two - I had a bit of space and light.

They said they were al-Qaeda, they were Taliban. They told me that they had no problem with me personally, they had a problem with my country. They said they had taken me because I was a Westerner and my country was at war with Afghanistan.

I was given a piece of paper to write down information about myself, to be passed onto a Taliban "cabinet" for background checking. They needed to check I wasn't a member of the special forces or a spy or a diplomat - all of which would have meant my immediate execution. After the background checks, this piece of paper was to be passed to the French authorities as proof I was alive.

Afterwards, I managed to hang on to one sheet of paper and the pen. I used it to write down a wish list for my life after I was freed, which I kept throughout my detention.

Pierre wrote the list in English because he had been working for some time in the language - he was also worried that if the list was discovered the "cryptic" French words would worry his captors

Search hard and you will find the word ukulele in the list - Pierre had bought one recently but had yet to learn how to play it properly

I also made a paper chessboard, and killed time constructing chess problems.

After about 10 days, they said they were going to take me to Kabul and give me back my life.

They got me out of the hole, bound my hands behind my back and blindfolded me again. I was put on a motorbike. But instead of taking me back to the city, I was taken down bumpy trails, over rivers and into the mountains. I've had some interesting rides on motorbikes before but never one like that.

They were taking me to my next hole.

It's utterly frustrating to play cards with a guy that could put a bullet in your head at any moment, especially when he is cheating Pierre Borghi

But before that, I had 10 very strange days living with an Afghan family, assisted by two Taliban fighters who kept guard over me (these were new guards - I changed hands a number of times throughout my incarceration).

It was surreal - we ate together, slept together, watched videos on their cellphone together. I even taught them some card games that we played for hours and hours. It's utterly frustrating to play cards with a guy that could put a bullet in your head at any moment, especially when he is cheating.

But the fighters either got tired of watching over me, or had to go and fight in the mountains, or a trade agreement had been made and they had to leave.

So I was moved to a more convenient place for them to keep me - a very small hole under a trapdoor in the floor of a barn, in which I couldn't lay flat or sit up. I had one three-litre bucket to use as a toilet. There was no light, none at all. I was kept there for the next three-and-a-half months. I was only allowed out three or four times, to shoot ransom videos. My hands and my feet were chained together. The only sense of time passing came from the occasional noise outside. A farmer chopping wood, a helicopter flying overhead. But the Afghan winter is horribly silent.

I was really bored. So what did I do?

Previously in the Magazine With no communication for days on end and a complete loss of contact with the outside world, hostages and prisoners sometimes wonder whether they still exist. What strategies can they adopt to prevent themselves from going mad? How do people survive solitary confinement?

I mentally drafted thesis projects, books and the blueprints for houses and towns (I was trained as an urban planner).

When I was hungry, I thought about food. I prepared dream recipes that I am still planning to try out when I have some friends over.

I also started talking to myself and singing songs. I thought to myself: "Don't worry, you're talking aloud, but you need it and are conscious of it."

I also talked to the people I loved - or imagined I talked to them - and prayed a bit.

You could say that I remained as French as I could - humour and self-deprecation were key tools in keeping me sane.

The chains restraining me were loose enough for me to get a foot and a hand free. The trapdoor was not locked and I began to explore the barn, sometimes spending whole hours - at night - out of the hole. I started to nurture a hope that I might escape.

But the Afghan winter is not only silent, it's also very cold. My experience of the country told me that if I broke free at night wearing the sandals and summer clothes I had been allowed to keep, I would end up a frosted corpse.

So I waited.

Image caption An image from Borghi's 2012 trip to the central highlands of Afghanistan

I had to do the videos, to prove I was alive. They told me what to say. "Tell your country that you're sick, you're tired, you want to go home. Tell them to give us what we want. Say hello and pass on a message to your family and country and religion."

For your family's sake, you try to keep yourself together, to be positive, to be kind with your words, so they don't freak out.

On the morning of 28 March, I was taken out of my hole, to shoot another of these videos.

In the space of 10 minutes, I was told I would be killed in the next few days as France was not meeting the Taliban's demands. I was given some letters my family had written and sent through the secret services, and then put back in the hole.

This was my very lowest point.

In an attempt to remain rational, I calculated how long it would take for this last video to be passed to the French authorities, and for them to make a decision about the ransom demands. I spent 10 days in torment, trying to weigh the risk of staying against that of escaping.

It's a love story between me and that country and the people of that country - I will probably go back in a few years

Then I made up my mind. I thought I couldn't afford to wait one more day - that at any moment, some executioner would show up to cut away what was becoming an embarrassing loose end for the Taliban.

There was a tiny window in the barn, about 3m above the ground.

On the night of 7 April, I wrapped my chains - still attached to one arm and one leg - in some rags to keep them quiet. Then I got out of my hole and climbed up to the window on some discarded furniture.

Outside, I saw lights shimmering away on the right-hand side, in the far distance. There's not much street lighting in Afghanistan, so I figured this was a military base of some sort.

I dropped some food, sugar and tea that I had saved over the last few days through the window, and then tried to squeeze through.

When I reached my hips, I got stuck. I freaked out. But after a few twists I fell in a heap on the outside. I would never have been able to do that without the 25lb (11kg) I'd lost over the last four months. You might call it the Taliban diet.

I started walking towards the lights, stumbling and falling in the freshly ploughed fields. I was talking to myself: "Ha, so you like coming home stumbling at night? It's your time man, make this the walk of your life!"

I passed near some checkpoints on a nearby road. There was no way of knowing if they were run by the army or the Taliban. So I went down to a crawl, hiding behind rocks and pressing myself against the hillside.

Later on that night I found myself enmeshed in razor wire, and I had to change direction when some dogs started to bark at me.

I walked all night - eight, nine, 10 hours. By the early hours, as the morning prayers echoed all around, my aching legs struggled to keep moving, but I was getting closer to what seemed to be a large city.

Image caption Pierre Borghi shortly after his escape

I reached a medium-height building, with an enclosed courtyard and watchtowers. I went to the gate, and as I was looking puzzled at the signs by the entrance, the military policeman on watch shouted to me.

"Kudja meri?" - Where are you going?

"Inshallah be Kabul merim" - If God allows, I'm going to Kabul.

He pointed his AK-47 at me, not really knowing what to do with this insane-looking guy in a salwar kameez with a huge beard, who was pretending to be French and making wild claims about being locked up by the Taliban in very sketchy Dari. So he called the commandant, who called the general, who called interpreters, who asked me questions. Another background check.

A few hours later, I was taken to Kabul in a military convoy with the general. While I was sitting in the car I thought about how, at that very moment, my keepers would be coming to check on me. I couldn't help smiling to myself as I thought of their faces as they lifted the trap-door to my hole, which I had been so careful to close again after I got out.

It wasn't till the end of that day that I was handed over to the French authorities in Kabul. They took me to the military hospital, where the chief surgeon welcomed me with a nice big pair of bolt cutters.

My legs ached from the night-time walk that had followed such a long period of inactivity, but physically and mentally I was in a pretty good way. Everyone was surprised, including me.

I took my first shower in 131 days and I was finally able to call home.

"Hi mum," I said. She said it was the happiest day of her life. Very rarely had I cried during my time with the Taliban, but I did cry when I made that call.

Pierre Borghi's Afghanistan

Image caption Two boys from Kabul Informal Settlements attend a distribution of blankets, clothes and firewood, to help them get through the harsh winter 2011-2012. Image caption A man selling pomegranates in the streets of Kabul, in the district of Qala-e Fatullah (Borghi was abducted in the same neighbourhood a week after taking this photograph). Image caption Buzkashi - the central Asian version of polo - is often played to celebrate weddings. Here, the village of Balaghli in the central highlands is competing against another village. Image caption Unlike polo, buzkashi games can go on for many hours, even days. Image caption Men in Balaghli share a breakfast. Bread and tea are staples and sometimes the only food available. Image caption Children wonder if their footwear is appropriate - their rural village in the district of Ruy-e Doab is affected by yearly flash floods. Image caption A baker and grocery store in Kabul. Image caption Near the city of Aybak, north Afghanistan, families picnic close to the remains of a Buddhist stupa. Image caption An empty water tank in the central highlands. Years of war and neglect have left much of the infrastructure obsolete and useless. Image caption Ruy-e Doab, in the central highlands. Image caption A schoolyard in the village of Ruy, in the Ruy-e Doab area. Successive invading forces have abandoned all types of machinery as they made their retreat from Afghanistan - these tanks are Russian. previous slide next slide

I met French diplomats. We talked about how they'd been dealing with my case, and what their plans had been for me. I don't think they would ever have agreed to the ransom demands.

Today, I am back in Europe, trying to sort myself out. I still have a sort of longing for Afghanistan - it's a love story between me and that country and the people of that country. I will probably go back in a few years - when things have calmed down a bit.

Until then, my plan is to implement that wish list, starting with learning how to play some decent tunes on the ukulele - something I've wanted to do for years. It seems as good a place as any to start enjoying my bonus life - my free life.

Outlook is broadcast on BBC World Service. Listen to the episode featuring Pierre Borghi's interview via iPlayer or get the Outlook podcast.

You can follow the Magazine on Twitter and on Facebook