Having promised to close the Guantanamo Bay prison during his first year in office, President Obama will leave about 40 prisoners there when he completes his second term. It's a failure that has something to do with Obama's reluctance to press his legal authority and something to do with the sluggishness of his appointees at the Pentagon; but it's mostly the result of obstructionism by Congress, which foolishly blocked the transfer of detainees to prisons in the United States and placed onerous conditions on their release to other countries. Given the difficulties he faced, Obama has done the country a service by greatly reducing the blight that Guantanamo placed on the country's international reputation. Now he must hope Donald Trump does not give it a new life.

As President George W. Bush seemed to recognize by the end of his tenure, the warehousing of hundreds of foreign terrorism suspects on the U.S. base in Cuba was a tragic mistake that did far more harm than good to the cause of counterterrorism. The mistreatment of some detainees alienated even close U.S. allies and served as a recruitment tool for Al-Qaida and the Islamic State, which invariably parade their Western detainees in orange jumpsuits like those Guantanamo made famous. Bush pared the detainee population from more than 700 to 242 before leaving office and established systems for reviewing the prisoners' cases and trying those accused of war crimes before military commissions.

Obama's contribution has been to find new homes for all but three or four of those cleared for release — some of whom have remained in Guantanamo years after they were judged eligible for transfer. Those who remain include 10 who were convicted or are being tried by the commissions and two dozen who cannot be tried and are considered too dangerous to release. As importantly, Obama demonstrated that it is possible to wage war against international terrorist groups without resorting to Guantanamo; on his watch, suspects have been interrogated on ships or in other extraterritorial locations, but none have been sent to Guantanamo.

U.S. prosecutors have shown also that it is possible to efficiently try, convict and imprison those accused of terrorist acts in the federal court system. Meanwhile, the flawed military commissions in Guantanamo have grossly delayed justice, especially for the ringleaders of the 9-11 attacks. As the Washington Post has reported, their trials may not begin until 2020. For Al-Qaida chieftains, run-of-the-mill militants and even swept-up innocents, Guantanamo has a one-way door. Once they're inside, it becomes extraordinarily difficult to try the guilty or release those who are no longer a threat.

Having loosely promised during his campaign to "load [Guantanamo] up with some bad dudes," Trump ought to carefully consider this history. If his desire is to try and convict captured terrorists, U.S. courts have proved to be the best venue, and federal supermax prisons have had no trouble holding those convicted. If he wishes to avoid handing easy propaganda victories to U.S. enemies, Trump will not send new prisoners to Guantanamo, but instead finish Obama's work and shut it down.

FROM AN EDITORIAL IN THE WASHINGTON POST