Updated

A federal judge ordered the Bush administration Tuesday to immediately free 17 Chinese Muslims from Guantanamo Bay into the United States, a dramatic ruling that could set the course for releasing dozens of other prisoners at the naval facility in Cuba.

The Bush administration announced plans to ask an appeals court to block the order, calling it a threat to national security and contrary to federal laws.

"Today's ruling presents serious national security and separation of powers concerns and raises unprecedented legal issues," Justice Department spokesman Brian Roehrkasse.

In a stern rebuke of the government, U.S. District Judge Ricardo M. Urbina said it would be wrong to continue holding the detainees since they are no longer considered enemy combatants. Known as Uighurs, the men have been in custody for nearly seven years.

Over the objections of government lawyers, Urbina ordered their release in Washington D.C. by Friday. It was the first court-ordered release of Guantanamo detainees since the prison camp opened in 2002.

"Because the Constitution prohibits indefinite detentions without cause, the continued detention is unlawful," Urbina said, prompting cheers and applause from local Uighur residents and human rights activists who packed into the courtroom.

Urbttacks" of Sept. 11, 2001, to seek release into the U.S.

At issue is whether a federal judge has the authority to order the release of Guantanamo prisoners who were unlawfully detained by the U.S. and cannot be sent back to their homeland. The Uighurs, who are Turkic-speaking Muslims in western China, have been cleared for release from Guantanamo since 2004 and ordinarily would have been sent home.

Wang Baodong, spokesman for the Chinese Embassy in Washington, reiterated Beijing's argument that the Uighurs are terror suspects and should be returned to China. "We ask the U.S. side to take into serious consideration of the repeated requests of the Chinese side, and handle the issue in a prudent way so as not to further harm their bilateral cooperation on combating international terrorism," Wang said.

The Bush administration has refused to turn the Uighurs over to China because they might be tortured. The Bush administration says it has found no other country is willing to accept them. Albania accepted five Uighur detainees in 2006 but has since balked on taking others, partly for fear of diplomatic repercussions from China.

Uighurs are from Xinjiang — an isolated region that borders Afghanistan, Pakistan and six Central Asian nations — and say they have been repressed by the Chinese government. China has long said that insurgents are leading an Islamic separatist movement in Xinjiang. The Uighur detainees were captured in Pakistan and Afghanistan in 2001.

Urbina's decision has broader implications for the future of the Guantanamo prison, which the Bush administration has said it wants to shut down after "working with other countries to take people back under the right circumstances."

A federal judge is set later this month to hold hearings on other Guantanamo prisoners challenging their detention as so-called enemy combatants.

ney with the Center for Constitutional Rights, said she hoped the decision would encourage other foreign countries to take in Guantanamo detainees who have not been charged.

"Finally, we are beginning the process of taking responsibility for our mistakes and fixing them," she said. "Allowing these wrongfully detained men a fresh start would also provide the U.S. a fresh start — an opportunity to turn a page and finally take a position of leadership in closing Guantanamo."