Ahmed Errachidi, 47, is a Moroccan chef. Having spent much of his adult life living in London, he was arrested in Pakistan, near the border with Afghanistan, in January 2002. Handed over to the American authorities, he was held in military bases in Afghanistan before being transferred to Guantánamo Bay, where he spent five-and-a-half years, most of them in solitary confinement. He was released in 2007. He has never been charged with any crime.

You grew up in Tangier. What brought you to London?

I first went there in 1985, aged 19. I was young and wanted to discover the world, to meet people. I married a British woman. [The marriage later broke down.]

And you got into cooking...

I started as a kitchen porter. But I had a passion for food and I began to cook the odd thing, and my bosses saw I could do it well and gave me more responsibility. I loved bringing ingredients together, creating dishes that made people happy.

On 11 September 2001, you were in a cafe in north London... Can you describe your feelings that day?

Shock and horror. No one I was with understood what was going on. We thought it was a plane crash. Then it became clear it was a terrorist attack. I felt a terrible sense of loss.

Just a few weeks after 9/11, you travelled to Pakistan. Why?

Work was quiet and I realised I couldn't keep travelling back and forth between Morocco and London. I'd married again, and my wife and sons lived in Tangier. So I started thinking about starting a business and decided to import silver from Pakistan. In August 2001, I learned that my youngest son, Imran, had a heart problem and might need an operation. We needed money. So I went to Pakistan to get things started.

But then, while there, you decided to travel into Afghanistan...

The American bombing of Afghanistan had just begun, and I would watch the images of suffering on the news in my hotel room. It was all happening less than 100 miles away. I just had an urge to try and help. I was in pain myself because of my son and as soon as the idea crossed my mind to help those people, I started to feel better. As a Muslim, if you want God to help you in something, you need to help others. So I crossed the border.

You were arrested just inside Pakistan, on your return from Afghanistan. Did you have any inkling at this stage that you might be sent to Guantánamo?

No. When the Pakistanis arrested me, they lied. They said they just wanted to make sure I wasn't on any wanted list, then they'd let me go. I remember thinking, each week when Friday came round: "Oh no, that means I'm not going to be released till Monday." That's how optimistic I was then. It seems almost funny now.

You were held at military bases in Bagram and Kandahar before being transferred to Guantánamo. While there, you were interviewed by British interrogators. Didn't they help?

They said there was nothing they could do. Their hands were tied. Although one MI5 agent told me that, if I was telling the truth, he'd get me released. I remember asking him how long it would take to check my story. His exact words were: "It may take weeks."

What happened when you arrived in Guantánamo?

Exactly the same thing as happened to every new prisoner. After a 26-hour journey, shackled and blindfolded, I was taken to an interrogation room and the first thing they said was: "Do you know Osama bin Laden? Did you know about 9/11 before it happened?" And then a female interrogator told me that all my rights had been taken away, that if I didn't co-operate I was going to spend the rest of my life there. But since I'd done nothing wrong, I didn't know how to co-operate.

During your time there you were subjected to constant, often astonishing cruelty by the US soldiers – beatings, sleep deprivation, forced nudity. Do you feel contempt for them now?

The ordinary soldiers were executing orders. They were very cruel, but they were being used as well. They were told that we were terrorists who had been trained not to feel pain. If I was to meet them today, I would tell them that what they did was wrong, but I would forgive them. But the politicians, the generals in charge – I will never forgive those people. I believe they need to stand trial.

You were one of the few detainees who spoke English. What difference did that make?

It meant I was always in contact with the soldiers. Each time there was a problem, they called me to translate. So I was always in their face. I couldn't hide. And that made me a target. They assumed I was a troublemaker, a leader. That's why they gave me the nickname "the General".

You write of the sense of solidarity you felt with other prisoners.

We were like a family. What brings people together is having something in common, whether a religion or material interest. We shared one thing in common, and that was pain.

How did you get out?

My lawyer, Clive Stafford Smith, dug around and discovered that the accusations against me couldn't be true, that I had been working in London like I'd always said. It wasn't hard to check these things. If the Americans had wanted to, they could have done this.

What was returning to normal life like?

It took me a very long time to learn how to walk without shackles. I would take three steps and think I couldn't go any further. Even now, my life is not the same. The five years I spent in Guantánamo are behind me, but it doesn't feel like that. It feels as if they're still in front of me, always present. Life doesn't taste the same.

What are you up to now?

I live in Morocco with my family. I've opened a restaurant. But even that's not a source of pleasure. I planned the menu, trained the chefs, but I don't spend much time there. My heart is no longer in the kitchen. I enjoy my family but not to the full, because I'm still not a free man. I've not been allowed a passport since I got out of Guantánamo. The Americans don't want me to travel.

What made you write a book about your experiences?

Because I have a sense of obligation to tell the world what happened behind the wires of Guantánamo. I am very pleased that I have done this. I thank God for giving me the strength.

The General: The Ordinary Man Who Challenged Guantanamo is published by Chatto