The decision reverses Obama''s policy. He had said he wanted to close the controversial site "as soon as practicable".

US President Donald Trump has signed an executive order to keep Guantánamo Bay military prison open in a major reversal of his predecessor Barack Obama’s policy.

Announcing the move in the State of the Union address on Tuesday night, Trump said he had just signed the order directing Defence Secretary James Mattis to "re-examine our military detention policy and to keep open the detention facilities at Guantánamo Bay".

The decision reverses Obama’s policy. He had said he wanted to close the controversial site "as soon as practicable".

In his speech, Trump raised the prospect of the Islamic State prisoners being sent to Guantánamo Bay, CNN reported.

"I am asking Congress to ensure that in the fight against the IS and Al Qaeda we continue to have all necessary power to detain terrorists wherever we chase them down, wherever we find them. And in many cases for them it will now be Guantánamo Bay," Trump said.

"The US may transport additional detainees to US Naval Station Guantanamo Bay when lawful and necessary to protect the Nation," the order stated.

It called the detention operations at the facility "legal, safe, humane, and conducted consistent with the US and international law".

The facility in Cuba has been used since the 9/11 attacks to detain what Washington calls "enemy combatants", but only 41 prisoners remain there.

Hundreds were transferred away from the facility during the Obama era.

A White House statement confirmed the order had been signed to resist the detention facility’s closure.

The order stated that the risk of recidivism among the remaining prisoners was high, saying they represented "the most difficult and dangerous cases from among those historically detained at the facility".

"Terrorists are not merely criminals. They are unlawful enemy combatants. And when captured overseas, they should be treated like the terrorists they are," Trump said.

"In the past, we have foolishly released hundreds of dangerous terrorists only to meet them again on the battlefield," he added, giving the IS group’s leader Abu Bakr al-Baghdadi as an example.

The first detainees were sent there in January 2002 and more than 700 have been held there since — many without charge or criminal trial.

The facility has been controversial since its opening with human rights groups complaining about conditions there amid allegations of torture.

The Obama administration signed an order in 2009 to close the site within a year but faced eight years of tight restrictions from lawmakers on the transfers.