The June ruling said that inmates in Guantanamo Bay had the right to know under what charges they were being held and what the evidence was against them.
Thursday's decision marks a fresh embarrassment over the camp for the Bush administration and comes after Barack Obama, the US president-elect, pledged to close the prison camp after taking office in January.
The White House said later on Thursday it disagreed with the court's ruling and that the Justice Department was reviewing the decision on the five Algerians.
"This ruling does demonstrate the need for Congress to enact procedures that allow these petitions to be adjudicated in a way that is fair to the detainee but that allows the government to present its case without imperiling national security," said Tony Fratto, a White House spokesman.
The US government had accused all six of the men of planning to travel to
Afghanistan to join the al-Qaeda network and fight against US-led forces in the country.
|About 250 people are still believed to be
held at the camp [GALLO/GETTY]
But their lawyers say there is no evidence the men ever would have ended up ona battlefield or posed any threat to the US.
Michael Ratner from the Centre for Constitutional Rights, who acted as a legal advisor to the men, told Al Jazeera he was overjoyed by the verdict.
"This is a huge huge decision. Not only for those five men but for how it showed that the US government was off the chart in what it was doing to people."
Ratner said he hoped that the decision would lead to similar rulings in other cases involving Guantanamo detainees.
Judge Leon said the allegation against the men was based on a single source and that he did not have enough information to judge the source's reliability or credibility.
However the judge ruled the government did provide enough evidence that one of the detainees, Belkacem Bensayah, had planned to take up arms against the US in Afghanistan.
Boumediene and the other five men were initially detained by US authorities on suspicion of plotting to bomb the US embassy in Sarajevo, Bosnia-Herzegovina, in October 2001, and transferred them to Guantanamo in January 2002.
However the Justice Department has reportedly since dropped the embassy bombing accusations.
Last month, US district judge Ricardo Urbina also ordered the release of 17 Chinese Muslims, members of the Uighur ethnic group, after the government acknowledged they were not enemy combatants.
About 250 prisoners are still being held at the US naval camp in Cuba on suspicion of "terrorism" or links to al-Qaeda or the Taliban. Most were detained during the US-led invasion of Afghanistan in 2001 after the September 11 attacks in the US.
Most have been held for years without being charged and many have complained of abuse, and the camp remains one of the most controversial aspects of the Bush administration's so-called war on terror.