WASHINGTON — At the National Archives here, standing in front of a backdrop depicting the Constitution, the Bill of Rights and the Declaration of Independence, President Obama declared that operating the torture prison at Guantanamo set back “the rule of law” in the United States and compromised its moral standing in the world.

He delivered a passionate defense of his decision to shut down the facility by January 2010 and said “we’re cleaning up something that is quite simply, a mess, a misguided experiment.

“There are 240 people there who have now spent years in legal limbo. In dealing with this situation we do not have the luxury of starting from scratch…The problem of what to do with Guantanamo detainees was not caused by my decision to close the facility; the problem exists because of the decision to open Guantanamo in the first place.

“I am not going to release individuals who endanger the American people,” the president said, “However, we must recognize that these detention policies cannot be unbounded…I want to be very clear that our goal is to construct a legitimate legal framework for Guantanamo detainees.”

The president also discussed his decision last week to oppose release of photos showing torture of detainees between 2002 and 2004. “Releasing these photos would inflame anti-American opinion, and allow our enemies to paint U.S. troops with a broad, damning and inaccurate brush, endangering them in theaters of war. I had to strike the right balance between transparency and national security,” Obama said.

The president’s speech came only a day after a majority of senators, including most Democrats, denied his request for $80 million to close Guantanamo. The 90-6 vote followed a similar move in the House a week earlier. The votes showed that Democrats in both houses remain fearful, if not about the closing of Guantanamo itself, of the ability of Republicans and the right wing, generally, to make political hay on the issue.

Former Vice President Dick Cheney, widely viewed as the chief architect of the Bush administration’s torture policy, attacked President Obama’s national security policies in a speech he gave right after the president finished delivering his remarks. Cheney, speaking at the headquarters of the right wing American Enterprise Institute here, said that the purpose of his continuing campaign against the president’s policies is to “keep the Obama administration from catapulting to the left” and that Obama’s plans to close the prison would make Americans less safe..” Cheney has made no secret of the fact that his administration enthusiastically backed the “enhanced interrogation techniques” that the Obama administration has now banned and has also argued that Guantanamo needs to remain open because “there is not a congressional district in the nation” that would want to take the detainees for trial or for holding until trial.

Pushing back against that criticism of his policies, voiced also by some lawmakers, the President has decided to send a top al-Qaida suspect held at Guantanamo Bay to New York to stand trial for the 1998 bombings of U.S. embassies in Africa. The suspect, Ahmed Ghailani, will be the first Guantanamo detainee brought to the United States and the first to face trial in a civilian criminal court.

The president said he believes “with every fiver of my being” that America cannot be kept safe unless it enlists the power of our most fundamental values.”

Obama explained that he has ordered a review of all the pending cases at Guantanamo. This involves wading through a flood of legal challenges that, an administration official said, consumes the time of government officials whose time would be better spent protecting the country.

The administration says that Guantanamo has become a “recruiting poster” for al-Qaida because prisoners were being held indefinitely without changes and some were subjected to “enhanced interrogation,” including water boarding – a drowning technique that Obama has called torture.

The closing of Guantanamo implies that its inhabitants must be either released or sent to other prisons, the administration’s press secretary, Robert Gibbs, said on Wednesday. “The president has not decided yet where some of the detainees will be transferred,” he noted.

Republicans have tried to stir the pot on the issue, saying the detainees are too dangerous to bring into U.S. prisons.

They may not get too far with that approach. Only yesterday, for example, the mayor of Hardin, Montana, in the heart of what some call “Cheney country,” told the World that his town was prepared to take 100 of the detainees who could be housed in a local facility there. The mayor said the presence of federal police that would accompany the detainees would, if anything, “enhance” safety and security in the town and that, in addition, Hardin would see at least 100 new jobs created. The town of 3,500 has an unemployment rate of 10 percent, he said

Senators in both parties used the issue of lack of specific plans about where to house detainees as the reason for their vote against funds to close the prison.

Some of the Democrats who voted against the funds were further frightened because FBI Director Robert Mueller had told Congress that bringing Guantanamo detainees to the United States could pose a number of risks, even if they were kept at maximum security prisons. Only six Democratic senators voted for the funds to close the prison. Other Democrats say they will approve the plans when they are presented to them.

The administration plans to try some of the detainees in civilian courts. It says, however, that some can be tried in military courts with “modifications” made from the way they were structured by the Bush administration. Still others could be sent to other countries.

Groups like the American Civil Liberties Union and others have expressed vocal opposition to the continuation of any military tribunals, even in “modified” form. Obviously concerned about such criticism, the president met Wednesday in the White House with ACLU Executive Director Anthony D, Romero and with members of the Center for Constitutional Rights and Human Rights Watch. There is no indication yet that anything said on the issue of military tribunals has resulted in any change in position by the groups.

Observers note, however, that a meeting at the White House of the president and leaders of civil liberties groups is unprecedented