President Donald Trump has signed an executive order keeping open the controversial U.S. prison at Guantanamo Bay, Cuba.

Trump announced that move during his State of the Union address on Tuesday night.

The prison on the American military base at Guantanamo Bay has been used for years to detain accused terrorists and enemy combatants.

The facility has been criticized for its grim conditions, and the U.S. policy of trying detainees, if at all, before military tribunals instead of criminal courts. Trump's decision to keep it open was immediately condemned by groups that have lobbied for its closure.

"Terrorists who do things like place bombs in civilian hospitals are evil. When possible, we annihilate them," Trump said during his speech.

"When necessary, we must be able to detain and question them. But we must be clear: 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 — including the ISIS leader, al-Baghdadi."

"So today, I am keeping another promise. I just signed an order directing [Defense] Secretary [James] Mattis to re-examine our military detention policy and to keep open the detention facilities at Guantanamo Bay," the president said.

"I am also asking the Congress to ensure that, in the fight against ISIS and al-Qaeda, we continue to have all necessary power to detain terrorists — wherever we chase them down."

The advocacy group Physicians for Human Rights blasted Trump's decision.

"The facility is a symbol of U.S. torture and injustice known around the world," said Dr. Homer Venters, director of programs at PHR. "It represents the unlawful, immoral, and harmful regime of indefinite detention and should be shuttered immediately."

"Physicians for Human Rights has long demonstrated how policies of torture, ill-treatment, and indefinite detention have caused lasting physical and psychological harm to detainees and have undermined the rule of law. Most of the men remaining at Guantanamo have been there for more than a decade without charge or trial," Venters said.

"Many have been tortured and abused, and they have all been denied full protection under the Geneva Conventions. To this day, detainees continue to be subjected to ill-treatment in the form of force-feeding and medical neglect and continue to face difficulty receiving proper medical treatment or rehabilitation as torture survivors."