Here I am in Guantánamo Bay. I was meant to be a Muslim extremist, one of the "worst of the worst", according to the former United States defence secretary Donald Rumsfeld. Indeed, because I am still here and 613 detainees have left, you might think that I am the worst of the worst of the worst – although perhaps the fact that I was cleared for release six years ago would give you pause for thought.

As I sit alone in my cell, I learn about acts of terrorism that take place around the world. Because the censors here do not let us have the news any more as a punishment for being on hunger strike, I have only heard the bare bones of what happened in Woolwich but, even without knowing all the facts, it is easy for me to condemn it. Just yesterday I was talking to another detainee about the murder of Lee Rigby. Neither of us could understand how anyone could think such an act was consistent with Islam. I condemn it regardless of the men's motive. I don't know what they thought might be achieved by it. Perhaps they were just mentally ill.

The same is true of the attack on the Boston Marathon in April. Maybe those who killed the innocent thought somehow that their attack was going to strike a blow against those who were fighting Muslims in Afghanistan or Iraq, or the Americans who were killing innocent children with drones in Pakistan and Yemen. But their actions were just plain wrong. You do not kill innocent people on the streets of London or Boston and say that is a jihad for justice.

It is important to recognise that the Americans do evil things as well. They say their motivation is to fight terrorism, and fighting terror is something I wholeheartedly support. But while their intentions may be good, their actions are also very wrong – when they kill a small child with a drone missile in Pakistan, or when they lock people up without trial in Guantánamo Bay. These actions are very unwise, too. They anger people who might before have been reasonable, so that more of them turn to extremism. They feed terrorism, just as once the denial of legal rights to those suspected of being Irish terrorists drew disaffected people to the IRA banner.

I was very pleased to hear this week that the prime minister, David Cameron, read the letter my daughter, Johina, sent him. I hope one day soon I will be back in the UK and I will be able to talk with politicians about how to reduce extremism – whether it is Muslims who misinterpret the Holy Qur'an, or members of the English Defence League who misinterpret Muslims.

We cannot establish justice by committing injustice. Evil begets evil.

But at the same time, goodwill brings goodwill. Misguided people will always commit misguided acts, but we do not need to live as if it might happen to each of us every day. Yet the US is still living the 9/11 nightmare. Guards on my block here in Guantánamo, who were just eight years old at the time of the attacks, now treat me as if I blew up the World Trade Centre. Why have we passed this nightmare to the next generation? They have been taught to hate. This is driving the world away from reconciliation. Our children are being taught to live in the past, not the future.

No matter who we are, we must bear in mind what we are fighting for. Right now, I am on a hunger strike for justice. To me, it is worth suffering for that goal, and I will continue my personal struggle one way or another till justice prevails. I am deeply grateful to those in Britain and the US who support us: I am particularly grateful to Jane Ellison, my MP. Maybe some people think that a Conservative MP would have no sympathy for someone like me, but she sees past the prejudice. And so do I. Our prophet teaches us that if we do not thank others, we do not thank our God.

When we combat terrorism, we are in a struggle to maintain our principles – ideas that terrorists and EDL members have apparently long forgotten. We must always ensure that we do not make our principles, and our respect for others, the first victims in the fight.

• This piece was dictated by Shaker Aamer to his lawyer on 10 June