Legislation that would prevent the transfer of terrorism suspects from a detention facility at Guantanamo Bay in Cuba to the United States is "unwise" and puts Americans at risk, Attorney General Eric Holder said Thursday.

The measure, included in a spending bill that passed the House on Wednesday, would prevent suspects from coming to the United States to stand trial and from being relocated to a domestic prison. Holder also wrote a letter to Senate leaders, who have not yet acted on the measure, outlining his opposition.

Approval of the legislation would be the latest setback in the Obama administration's efforts to close the Guantanamo detention facility, created by former President George W. Bush after the Sept. 11, 2001, attacks. President Obama had ordered the prison closed within a year of taking office, a deadline that has lapsed following congressional opposition to trying suspects in civilian courts.

"It simply does not make any sense to take away from the president options that he needs, options that I need, to keep the American people safe," Holder told a news conference in Washington. Eliminating the option to try suspects in civilian courts "is an unwise move and puts the American people at risk," he said.

There are 174 detainees remaining at Guantanamo.

Holder's letter to Senate Majority Leader Harry Reid (D., Nev.) and Minority Leader Mitch McConnell (R., Ky.) said that decisions on where to try terror suspects should be based on the "facts and circumstances of each case and the overall national security interests of the United States."

Holder and Obama announced last year a plan to try Khalid Sheikh Mohammed, the accused mastermind of the Sept. 11 terror attacks, and four alleged coconspirators, in federal court in New York, about a quarter-mile from where the World Trade Center towers stood. They began reconsidering that decision after New York Mayor Michael Bloomberg in January said he wanted the trial moved.

In April, Holder said that the administration was still considering New York as a site for a trial and that other locations were under review as well. At the time, Holder said the administration had not decided whether to hold the trial before a military commission or in a civilian court.

Last month, Holder said the administration was "close" to selecting a trial location.