In this June 7, 2014, file photo, the entrance to Camp 5 and Camp 6 at the U.S. military's Guantanamo Bay detention center, at Guantanamo Bay Naval Base, Cuba. (Ben Fox/AP)

President Trump signed an executive order on Tuesday to keep the prison at Guantanamo Bay, Cuba, in operation indefinitely, suggesting that he may use the facility to house new terrorism suspects for the first time in a decade.

The order, issued as Trump delivered his first State of the Union address, solidifies the ­president's well-known intention to keep suspected militants locked up at the military facility, part of his promise to take a hard line on terror.

But it also sheds new light on his administration's approach to thorny detainee issues, indicating a willingness to end a decade-long moratorium on growing the prisoner population at Guantanamo.

"In the past, we have foolishly released hundreds and hundreds of dangerous terrorists, only to meet them again on the battlefield," Trump said in his address. "So today, I'm keeping another promise," making reference to the new measure.

The order rescinds key portions of a measure issued nine years ago by Trump's predecessor, Barack Obama, who promised to close Guantanamo but was unable to overcome political opposition to bringing detainees to the United States.

Sixteen years after the prison opened, 41 detainees remain at Guantanamo. Of the more than 700 who have been held there since 2002, only a small minority have been charged with a crime, and fewer still have completed trial in a military court.

Although the order may have little immediate effect, given that Obama was unable to close the prison even after making it a central presidential goal, it may intensify criticism from those who have argued that the prison is a stain on America's global reputation.

"The Trump administration is making a signature departure from the political and diplomatic consensus that once existed, that it's necessary and, indeed, imperative to the national security of the United States to close Guantanamo" said Wells Dixon, a senior staff attorney at the Center for Constitutional Rights, which represents some of the prison's detainees.

Even close allies have voiced concern over the years about a facility that has kept prisoners locked up without trial.

"It is sure to irritate allies and partners who feel strongly that this facility should be closed — and certainly not increased in its population," Joshua Geltzer, senior White House counterterrorism director in the Obama administration, said of the new measure.

The announcement caps a year-long discussion within the Trump administration about the proposed order. While some of Trump's top advisers advocated for a tough detainee policy that might expand the prison's use, many other officials have argued that Guantanamo has proved cumbersome and problematic.

The military commissions that were set up to try Guantanamo inmates, in particular, are seen as flawed. Suspects in the Sept. 11, 2001, attacks have been stuck in pretrial proceedings for years.

But the move also had influential allies, including Attorney General Jeff Sessions, who has long been an advocate of detaining terrorism suspects at Guantanamo and of trying them in military commissions.

Last March Sessions told radio show host Hugh Hewitt that he was in favor of bringing new enemy combatants to Guantanamo. "It's just a very fine place for holding these kinds of dangerous criminals," he said.

He added, "In general, I don't think we're better off bringing these people to federal court in New York and trying them in federal court, where they get discovery rights to find out our intelligence and get court-appointed lawyers and things of that nature."

Other officials favor trial for terrorism suspects in federal courts. Since 2001, federal prosecutors have obtained hundreds of convictions in international terrorism cases.

Trump's order breaks with not only Obama's policy but the intentions of his Republican predecessor, who opened the prison in the aftermath of the 9/11 attacks.

By the end of his presidency, President George W. Bush concluded that Guantanamo was doing more harm than good, said John Bellinger, legal adviser to the National Security Council and the State Department in the Bush administration, although in the end, he decided keep it open.

"President Trump is throwing more political bones to his base rather than making a determination based on what is best for U.S. national security," Bellinger said.

The new order instructs Defense Secretary Jim Mattis to develop recommendations within 90 days for handling suspected militants captured overseas, including procedures for possibly bringing them to Guantanamo.

Some legal experts have argued that bringing recently captured detainees to Guantanamo, particularly those associated with the Islamic State, could expose the Trump administration to challenges to the law that forms the basis for U.S. counterterrorism operations overseas.

Congress passed the post-9/11 Authorization for the Use of Military Force to be used against al-Qaeda and its affiliates, but it is also used more than a decade later as a basis for operations against the Islamic State and other militant groups. The U.S. government has been seeking to avoid court challenges to the law as a basis for detaining members of the Islamic State.

Anne Gearan, Joshua Dawsey and Ed O'Keefe contributed to this report.