US President Donald Trump announced Tuesday he would keep Guantanamo Bay open, breaking from his predecessor Barack Obama’s lengthy and ultimately failed efforts to shutter the maligned detention facility.

“I just signed an order directing Secretary Mattis to reexamine our military detention policy and to keep open the detention facilities at Guantanamo Bay,” Trump said, in his State of the Union address to Congress, in keeping with a campaign promise.

Under president George W. Bush, the US military hastily constructed a prison camp on Guantanamo Bay, located on the US naval base on the eastern tip of Cuba, in the months following the US-led invasion of Afghanistan after the September 11, 2001 attacks.

At first, inmates were held in cages and fenced in with razor wire, and conditions for the orange jumpsuit-clad detainees provoked a global outcry in 2002.

That early facility, known as Camp X-Ray, was soon replaced with more permanent structures and today, Guantanamo Bay consists of numerous high-security prison buildings.

At the height of its operations after 9/11, the facility held 780 people, detained mostly for their alleged ties to Al-Qaeda and the Taliban.

Since then, hundreds have been transferred back to their home countries or other places.

Some of the most notorious inmates, including several alleged 9/11 co-conspirators, among them accused mastermind Khalid Sheikh Mohammed, are still awaiting trial.

Their cases have been beset by legal woes at Guantanamo, where a bespoke criminal justice system grants detainees — who are considered “unprivileged enemy belligerents” — only some of the legal rights that US federal courts guarantee.

Of the 41 inmates remaining at Guantanamo, about 26 are trapped in legal purgatory.

These so-called “forever prisoners” have never been charged — yet they have been deemed too dangerous to release.

Some were cleared for release under Obama, but have been stranded at Guantanamo under the Trump administration.