Twelve years of detention without trial have ended for three Uighur men who have left Guantánamo Bay for Slovakia, the US Department of Defense announced on Tuesday, ending a clear mistake of the 9/11 era.

The three men – Yusef Abbas, Hajiakbar Abdulghuper and Saidullah Khalik – did not pose any terrorist threat to the US, a recognition the Defense Department came to during the Bush administration. A federal judge ordered them freed in 2008, and a 2009 panel appointed by President Barack Obama concurred. Their continuing detention was the result of a snarled political, bureaucratic and diplomatic process that underscored the continuing difficulty of closing the notorious detention center.

The diplomatic breakthrough came when Slovakia agreed to allow the last of Guantánamo’s Uighur population to “voluntarily resettle”, according to a statement from Rear Admiral John Kirby, the new Pentagon press secretary, who added that the US thanked Slovakia for its “humanitarian gesture”. There are now 155 detainees at Guantánamo, most of whom have not been charged with any offense.

With 19 other Uighur men, Abbas, Abdulghuper and Kalik were mistakenly captured in eastern Afghanistan, not far from a crucial 2001 battle at Tora Bora. An ethnic Turkic minority in China, the Uighur detainees said they had come to Afghanistan to escape persecution. They were given to the US for detention at a time when US forces were heavily reliant on Afghan proxies who had their own agendas and who accepted bounties for captives.

During the early days of their detention, the US interrogated the Uighur men brutally. In September 2002, Chinese officials were allowed to visit Guantánamo. According to 2009 testimony to a US House subcommittee, the Uighur detainees were subject to sleep deprivation, frigid temperatures and isolation. One detainee, Ablikim Turahun, wrote to a House foreign affairs subcommittee that the US troops supervising his detention followed instructions from the Chinese officials to take his picture without his consent.

“They called for American soldiers and ordered them to hold me, so that my picture could be taken. The soldiers grabbed me, pulling my beard, pressing on my throat, twisting my hands behind my back, and as a result my picture was taken by force,” Turahan wrote.

While the US eventually came to the conclusion that the Uighur detainees were not a security threat, the State Department just as quickly concluded that it could not remedy the initial detention error by sending the Uighurs back to China, since they were likely to face torture, abuse or additional rights violations by the Chinese government.

The Uighur detainees came to live in a Guantánamo facility separate from the rest of the detention population. While their treatment was less severe, they were not free men.

That left the option of finding new national homes for the Uighurs. In 2007, Albania accepted five. The following year, Judge Ricardo Urbina ordered the remaining prisoners freed to the US, on the grounds that the US could not hold men without cause. At least one ethnic Uighur community in the US, in the Virginia suburbs of Washington DC, enthusiastically volunteered to take in the detained men.

Urbina’s decision was reversed by other judges, who found that he had overstepped his judicial bounds. It was further stymied by bipartisan Congressional efforts, from the dawn of the Obama administration and which persist, to prevent any Guantánamo detainees from transfer to the US, even for continued detention.

In 2009, when reports of the Uighurs' release circulated, Mitch McConnell, the Republican leader in the Senate, portrayed the Uighurs as a threat abetted by the Obama administration.

“There’s a reason US law prohibits the entry of anyone trained in a terrorist camp. Why that law would be ignored to bring terrorist-trained detainees into American cities has not been answered by this administration,” McConnell said in a statement that signalled an early, sustained and thus-far successful fight to prevent the closure of Guantánamo Bay.

In 2009 Nury Turkel, a former president of the Uighur American Association, told ABC News Americans had nothing to fear from his countrymen.

“Americans should not be afraid of the Uighur prisoners in Gitmo because they have no beef with Americans or hostility towards the US. Actually, they're grateful to the US government for the freedom and opportunity that it has given to Uighurs in here," Turkel said.

This year, Judge Urbina told the Miami Herald: “There was not a shred of evidence that [the Uighur prisoners] were disliked by anyone – anyone but the Chinese government.”

Subsequent efforts to resettle the Uighur detainees sent them to places as far flung as El Salvador, Bermuda and Palau. None of the released men has been linked to an act of terrorism.

Obama recommitted himself to shuttering Guantánamo Bay’s detention center in 2012, shortly after winning re-election. He appointed new envoys for the task at the State and Defense Departments, and won a modicum of congressional support in a defense authorization bill he signed last week that removed a restriction on transfers from Guantánamo to overseas destinations.

“As the president made clear in his 23 May speech at the National Defense University, the Guantánamo Bay detention facility drains our resources and harms our standing in the world,” said army Lieutenant Colonel Todd Breasseale, the Pentagon’s chief spokesman on detention issues.

“The US government has worked diligently to generate resettlement opportunities for these three individuals and has engaged a number of different governments to seek their resettlement.”