He’s the television comedian best known for controversial jokes about swimmer Rebecca Adlington, The Queen and people with Down’s syndrome.

But Frankie Boyle is now using his fame, and wealth, for more serious ends, by donating tens of thousands of pounds of his money to help Britain’s last inmate at Guantanamo Bay to sue the MI6.

Yesterday the Glaswegian comic announced the £50,000 compensation he won from a recent libel victory against the Daily Mirror newspaper, would go towards a landmark legal attempt to sue Britain’s security services over accusations they have defamed Shaker Aamer, the only British resident still languishing without charge in Guantanamo.

Boyle, who has decided to retire from comedy early next year after repeated clashes over his controversial style of humour, unveiled his plan alongside Reprieve, the British-American charity which has long represented inmates of Washington’s extra-judicial jail.

Even Boyle, who is best known for his performances on BBC panel show Mock the Week, admits his involvement in the case sounds a little far-fetched. “I remember reading [the US pop star] Usher crashed a hot air balloon into something, and I thought ‘this is just a random word generator’”, he told The Independent yesterday. “It feels a bit like that.”

Clive Stafford-Smith, the director of Reprieve, admitted the libel action untested legal formula but said there was important legal ground that needed to be explored. “If the Daily Mirror says something bad about Frankie that embarrasses him or humiliates him then he has the right to sue,” he said.

“If, on the other hand, a far more powerful organisation, the British government and their agents, say something about Shaker – whereby instead of being humiliated he’s banged up in prison for eleven years for something he patently didn’t do and something he’s never been charged with – then the British government’s position is Shaker can do nothing.”

Aamer was arrested in Afghanistan in late 2001 and is the only British resident left in Guantanamo, a US detention centre in Cuba. He has been cleared for release by the US authorities but has yet to be freed as the Americans have insisted on returning him to Saudi Arabia. Although he holds Saudi nationality with his British residency, Aamer’s wife and four children – one of whom he has never met – live in London. The British government are supportive of him returning to the UK but the Americans have so far refused to hand him over.

A Foreign Office spokesperson said they could not comment on any on-going legal proceedings but Reprieve claim that they have already seen a response from Government lawyers claiming the security services are protected by legal privilege.