Washington: The United States has failed the handling of inmates at Guantanamo, holding men for years without reliable evidence while releasing others who posed a grave threat, according to leaked secret documents.

The trove of classified files released by the website WikiLeaks showed US officials struggling with often flawed evidence and confused about the guilt or innocence of detainees held at the prison at the US naval base in Guantanamo Bay, Cuba.

Hundreds of inmates who turned out to have no serious terror links were held without trial, based on vague information, including accounts from unreliable fellow detainees or statements from men who had been abused or tortured, the daily quoted the documents as saying.

One impoverished Afghan farmer with no ties to militants was held for two years without trial in a case of mistaken identity, the documents showed.

But US authorities in 2004 decided to release Abdullah Mehsud, a Taliban extremist who duped his interrogators into believing he had been conscripted by the insurgents as a driver. Mehsud, who gave a false name to his American interrogators, was sent back to Afghanistan where he organised a Taliban unit to assault US troops, planned an attack on Pakistan's interior ministry that claimed 31 lives, oversaw the kidnapping of two Chinese engineers and set off a suicide bomb in 2007 in Pakistan -- winning praise from Al-Qaeda chief Osama bin Laden.

President Barack Obama's administration, which has tried to close the controversial Guantanamo prison, denounced the 'unfortunate' release of the classified documents, part of a massive cache of secret memos passed to WikiLeaks last year.

Human rights groups, who have portrayed Guantanamo prison as a legal black hole, said the documents showed the need for courts to review the evidence against each detainee.