The men had been held under the Terrorism Act at Paddington Green station in west London after they were flown to Britain on Tuesday by the RAF.
They were freed after anti-terrorist police, working with MI5 and the Crown Prosecution Service, agreed that there were no grounds for their detention.
Tarek Dergoul, 26, a former care worker from east London, was released from custody at 9.45pm. Shortly before midnight the three remaining men – Asif Iqbal, 22, Shafiq Rasul, 26, and Ruhal Ahmed, 22, all from Tipton, West Midlands – were also released.
A Scotland Yard spokesman said police had coordinated arrangements for the men to be taken to a location of their choice.
The fifth man, Jamal Udeen, 37, from Manchester, was released hours after his arrival on Tuesday and was yesterday enjoying a reunion with his sister.
The families of the other detainees had earlier accused the police of “compounding two years of injustice” by holding the men until late last night and Gareth Peirce, who acts for Iqbal and Rahsul said the men were suffering from sleep deprivation.
Miss Peirce said they had already been interrogated “in completely coercive conditions” by the intelligence services in Cuba and the British police were carrying out “unnecessary and protracted” procedures.
“They have been questioned and I think it’s not appropriate for them to be detained any more. We told the police that they are simply compounding the unlawfulness of the last two years.” Robert Lizar, Udeen’s solicitor, said he wanted the American authorities to “answer for the injustice which he has suffered”.
He added: “He has been treated in a cruel, inhumane and degrading manner. He believes that the UK authorities have been complicit in terms of being involved in questioning him in detention and allowing that to continue. He’s an innocent man.”
In east London, Halid Dergoul said he had spoken to his brother Tarek in two brief telephone conversations before his release last night.
He said his brother had told him: “I’m feeling very positive and very strong and I want to clear my name and set the record straight.” Dergoul, the son of a Moroccan baker and a regular worshipper at Finsbury Park mosque in north London, was captured by US forces in Afghanistan’s Tora Bora mountains, an escape route often used by al-Qa’eda.
It is believed he may have lost a leg after suffering frostbite. Max Clifford, the publicist who has been consulted by Dergoul’s family on a no-fee basis, said the former detainee was likely to have a reunion at a safe house.
“I was told he was OK and mentally had held up pretty well,” he told The Telegraph. “But physically he was not in very good shape and was having difficulty walking.”
Dergoul’s brother said M15 had flown out to Cuba three times to interview the British detainees and found nothing. “They have not got a shred of evidence against them and I know that because I received reports about it.”
Steven Watt, a British lawyer with the US-based Centre for Constitutional Rights who represented Rasul and Iqbal in taking their case to the US Supreme Court, was scathing about their detention.
He said: “I think what happened in terms of them arriving at a military base in the UK and taken into custody was just window dressing for the benefit of the US government.
“It makes a complete nonsense of Guantanamo and confirms what we have been saying from the very start.
“They have spent two and a half years languishing in that prison – it is a complete travesty of justice. I think they are owed something by the US government but whether they will ever be able to get it is another thing.”
He added: “George Bush called them ‘bad guys’ . . . clearly by what’s happened here they are not bad guys, they are entirely innocent. They were in the wrong place at the wrong time.”
Additional reporting: Graham Tibbetts and John Crowley