IN THE first few weeks of Donald Trump’s presidency, the new administration prepared an executive order to make good on Mr. Trump’s campaign promise to “load [Guantanamo Bay] up with bad dudes,” directing the Department of Defense to bring new detainees to the prison. Secretary of Defense Jim Mattis and CIA Director Mike Pompeo disavowed the draft after it was leaked to the press, and the order — which also called for a policy review on the possible reopening of secret CIA prisons around the globe — was never signed.

Now the administration is trying again. The New York Times reports that an interagency group is drafting a policy that would reverse President Barack Obama’s decree calling for the closure of the prison and authorize Mr. Mattis to bring suspected terrorists to Guantanamo. This would be a grave mistake.

In a welcome development, none of the policies currently under consideration float a return to the use of CIA prisons — a practice which did great damage to the United States’ international reputation after 9/11. But even absent this provision, an executive order authorizing newly captured prisoners to be detained at Guantanamo would risk alienating U.S. allies.

Domestically, detaining ISIS fighters at the prison would be an invitation to years of risky litigation over the scope of government authority in the battle against the Islamic State. And short-sighted congressional restrictions on transferring detainees out of Guantanamo, along with a system for trying detainees by military commission that has proved painfully slow and mired in legal confusion, could consign any new detainees to custody without trial for decades. The military judge in the case against the 9/11 attackers has yet to even set a trial date.

In contrast, the government has had relative success in prosecuting terrorism suspects in federal court. In July, the Trump administration itself extradited a suspected al Qaeda recruiter from Spain to face criminal charges. And the administration recently received another indication of the viability of criminal prosecutions when a federal judge ruled in the government’s favor in the case of Ahmed Abu Khattala, who was interrogated aboard a ship sailing to the United States following his capture. The arrangement allowed government interrogators to question Mr. Khattala to gain intelligence before advising him of his right to remain silent, then inform him of his rights and restart the questioning with a new team of officials in order to build a criminal case against him. In holding that prosecutors could use Mr. Khattala’s statements after being read his rights, the court showed that criminal trials need not preclude the intelligence gathering that can be valuable for preventing attacks.

To be sure, this system is far from perfect: The judge in Mr. Khattala’s case hinted that the government may face restrictions on its ability to conduct lengthy interrogations at sea. But the cases of Mr. Khattala and Ali Charaf Damache, the suspect from Spain, demonstrate that the United States can fight terrorism without compounding the tragic mistakes of Guantanamo Bay. Mr. Trump would be wise to pay attention.