A Spanish terror suspect has been jailed for six years by a court in Madrid, after he was transferred from the US military base in Guantanamo Bay.
Abderrahmane spent more than two years at Guantanamo Bay prison
Hamed Abderrahman Ahmed was convicted of belonging to a terrorist organisation - namely al-Qaeda.
The court ruled that he had joined up and travelled to Afghanistan with the aim of becoming a fighter.
He was captured in Pakistan in 2001 and taken to Guantanamo before being transferred to Spain in 2004.
Judges said Abderrahmane had joined al-Qaeda in "full knowledge of the terrorist profile of the group".
The court heard that Abderrahmane, from the Spanish enclave of Ceuta in northern Africa, had told his family he was travelling to Madrid or London to further his Koranic studies.
He was arrested in Pakistan trying to leave the country after the 11 September attacks on the US, and later transferred to the US prison in Cuba - where around 500 men are being held without charge.
Speaking about his time at the controversial facility, he told the trial: "I will never be able to go into what happened."
He said the experience "destroyed my life psychologically and physically".
The court said the time he had spent in custody in Spain before the trial would be taken into account, but not the two years in Guantanamo.