One of the last Afghan detainees held inside the Guantanamo Bay US detention centre in Cuba has been freed after 15 years following negotiations with Washington, authorities said on Friday.

The secretive prison once housed hundreds of suspected militants captured by US forces during America's "war on terror", many held without charge or the legal power to challenge their detention.

US authorities faced accusations of torture and abuse against prisoners at the facility, with some allegedly held in cages and subjected to illegal interrogation techniques.

Most of the inmates have been released over the years, including senior Taliban leaders, but Asadullah Haroon had languished without charge.

"The charges against him were false and the release has proved that he was innocent, but who will return those years of his life?" said his brother Roman Khan from Peshawar in Pakistan, where the family live as refugees.

He said they were informed early Friday of Haroon's freedom.

"It's like Eid in our house, like a wedding. These are very emotional moments for us," Khan told AFP.

Haroon, believed to be aged around 40, is now in Qatar. He was arrested by US forces in 2006 while working as a honey trader travelling between Pakistan and Afghanistan.

The US government transferred him in 2007 to Guantanamo Bay, accusing him of being a courier linked to Al-Qaeda and serving as a commander with another militant group, Hezb-e-Islami.

In a phone call he had with his lawyers in October 2021, Haroon described his ordeal in the prison.

"I have been here illegally for the last 14 years. I have never been charged. I have never been convicted of a crime," he told them, according to a statement issued by his lawyers Friday.

"I am very weak now. I may be 38 years old, I am feeling around 60 years old. I have suffered physically and mentally for years now."

The Guantanamo Bay facility in Cuba
The Guantanamo Bay facility in Cuba GETTY IMAGES NORTH AMERICA via AFP / POOL

His release came after a hard battle, his lawyers said.

"Asadullah has suffered severe physical and psychological torture during his detention, including being beaten, hung by his wrists, deprived of food and water, and prevented from praying," their statement said.

"He has been subjected to sleep deprivation, extreme cold temperatures and solitary confinement."

His family, who fled to Pakistan during the 1979 Soviet invasion of Afghanistan, have admitted he was a Hezb-e-Islami member like many in their refugee camp, but said he had no links with Al-Qaeda.

His release came after "direct and positive" interaction between the Taliban and Washington, Afghanistan government spokesman Zabihullah Mujahid said in a statement.

Now that he has been released the Taliban must ensure that Haroon "does not pose a threat" to the United States and its allies, a State Department spokesperson said.

Mujahid said Haroon was one of two Afghan detainees remaining in Guantanamo Bay.

The other inmate is Muhammad Rahim, accused by the CIA of being a close associate of Al-Qaeda founder Osama bin Laden.

Afghanistan's foreign ministry spokesman Abdul Qahar Balkhi said the government was "hopeful" that Rahim will also be freed soon.

US President Joe Biden's administration has been working to reduce the number of detainees and eventually shut down Guantanamo Bay, which lies on the island of Cuba but is under US jurisdiction.

The Pentagon in April said 37 detainees remained at the sprawling facility.

"The Guantanamo Bay military prison is ... a global symbol of American injustice, torture and abuse of power," the American Civil Liberties Union said in a statement after Haroon's release.