COMEDIAN Frankie Boyle has given financial backing to a campaign to free the last British national imprisoned at Guantanamo Bay as the detainee prepares to mount the first ever defamation case against M15 and M16.

Boyle, from Glasgow, said the circumstances surrounding the detention of Shaker Aamer – who has been imprisoned for 11 years despite requests from the UK Government to President Obama and his predecessor George Bush for his release – was "everyone's worst nightmare".

Mr Aamer, originally from Saudi Arabia but a legal British resident, was arrested in Kabul in 2001 and sent to Guantanamo after UK security services claimed he was a key figure in a London-based cell of al Qaeda and an associate of Osama Bin Laden.

Mr Aamer has not been given the chance to defend the allegations against him and is one of the longest-serving inmates at the Cuban prison camp.

Boyle recently gave his £60,000 damages win from the Daily Mirror, who wrongly accused him of being racist, to the Reprieve organisation which is campaigning for Mr Aamer's release.

He said: "It's everyone's worse nightmare. It's Kafka and the worst nightmare anyone has been able to come up with – someone being deprived of their freedom and no idea why that is the case."

When asked if there were parallels between Mr Aamer's defamation case and his own, Boyle said: "There is an echo. There will be some racism involved in this case. What would happen if we were talking about a white woman? There would be a completely different approach. People are held in Guantanamo ... because of anti-Arab and anti-Muslim sentiment."

His lawyers have written to Foreign Secretary William Hague, the Foreign Secretary, and Theresa May, the Home Secretary, demanding an explanation for the false claims they say UK officials have made against him.

It comes after Mr Aamer implicated British officials in his torture in Afghanistan and Guantanamo Bay – allegations that are being investigated by the Metropolitan police.

Boyle said he believed Mr Aamer would eventually be released.

He said: "The Government has already said it wants him back. What we need to find out is why this is not happening."

Solicitor Clive Stafford Smith – who represents 13 Guantanamo prisoners – said no-one had sued the British security services for defamation before. He said: "It's never been done. They will claim they have absolute privilege and that the case will have to be heard in a closed court."

Mr Stafford Smith added: "It's not hard to prove what they have said is defamatory."

The solicitor claimed Mr Aamer was in Afghanistan with his wife and children at the time of his arrest.

Mr Aamer is said to have been involved in multiple protests against conditions at the camp, including hunger strikes with Mr Stafford Smith saying declassified information on his client revealed he had been beaten 266 times in 365 days.

The lawyer claimed Mr Aamer was in a "catastrophic state" with claims of suspected ulcers, back problems and crumbling fingernails.

A spokesman for the Foreign and Commonwealth Office said: "Mr Aamer's case remains a high priority for the UK Government and we continue to make clear to the US that we want him released and returned to the UK as a matter of urgency.

"The Foreign Secretary has raised Mr Aamer's case numerous times with Secretary Clinton and discussions continue. Any decision regarding Mr Aamer's release ultimately remains in the hands of the US Government.

"We have raised recent concerns with the US authorities and they have assured us that Mr Aamer remains in reasonable health."

The Foreign Office is also assessing the impact of National Defense Authorization Act for Fiscal Year 2012, which carries some provision for trial by military tribunal or transfer of prisoners to a country of origin.

Boyle has clashed with public opinion, media outrage, broadcasters and regulators over some of his material. Last year, Ofcom censured Boyle and Channel 4 for broadcasting "offensive" jokes about Katie Price and her disabled son Harvey on the Tramadol Nights show.

He is due to concentrate on writing after the conclusion of his last sell-out tour, The Last Days of Sodom.