A guards sits in a tower overlooking Guantanamo detention camp, at Guantanamo Bay US Naval Base, Cuba, Tuesday, May 15, 2007. (Brennan Linsley/AP)

Jane Harman, a former Democratic member of the House of Representatives, is president and chief executive of the Woodrow Wilson International Center for Scholars. Jack Goldsmith, a former assistant attorney general during the George W. Bush administration, is a professor at Harvard Law School and a senior fellow at the Hoover Institution.

In his State of the Union address last month, President Obama reiterated his determination to shut down the detention facility at Guantanamo Bay, Cuba. Some in Congress are resolved to stop him. Even Sen. John McCain (R-Ariz.), who has supported closing the prison in the past, joined a recent congressional effort to slow releases from Guantanamo on the grounds that the president has never presented Congress with a “concrete or coherent plan.”

Both sides are right. Guantanamo should be closed but not until the president presents a realistic plan and makes his case to Congress and the nation. Any blueprint must address very real issues related to the island facility’s 122 remaining detainees.

The easiest question is whether to release the 54 who the administration has determined aren’t dangerous. Many in Congress worry that these prisoners will return to the fight. Since 2009, Congress has restricted transfers from Guantanamo, and in recent years has required the defense secretary to certify that they are “no longer a threat to the national security of the United States” or, at a minimum, to craft a plan to “substantially mitigate the risk” of a return to the battlefield. This insistence on individualized, security-protective releases has significantly reduced the recidivism rate that resulted from bulk releases before 2009. But as the exchange last year of five Taliban members for Sgt. Bowe Bergdahl showed, this standard might need tightening to limit releases to only those persons who pose no threat.

A tougher issue is where to send the remaining non-dangerous detainees. Many come from Yemen, a cauldron of instability. The administration has already persuaded third-party countries to take 100 or so of these detainees, including several dozen in the past few months. Still, finding a place to send the remaining non-dangerous detainees will be hard; options have narrowed.

The biggest problem is a group of up to 68 higher-risk detainees. Seven are being tried in military commissions. But as Obama noted six years ago, the others “pose a clear danger to the American people.” The men in this category, the president explained, “received extensive explosives training at al-Qaeda training camps, or commanded Taliban troops in battle, or expressed their allegiance to Osama bin Laden, or otherwise made it clear that they want to kill Americans.”

Guantanamo cannot and should not be closed until there is a concrete plan to prosecute these men, or, if necessary, detain them in a lawful way that ensures they can never inflict grievous harm again.

Federal courts have ruled that these detainees can be lawfully held until the end of the relevant conflict, whenever that might be. But many cannot be criminally prosecuted because of evidence tainted by abusive interrogations, limitations in federal criminal law and other problems of fitting the demanding standards of criminal justice to the messiness of the terrorist battlefield. Scores of lawyers in two administrations have scoured the case files and case law and (reluctantly) agree.

What to do? Closing Guantanamo must not mean ending detention of these dangerous men, though the two are often confused. The main question is, where will they be incarcerated — in Cuba or in the United States?

The case for sending them to a secure but humane prison in the United States is that keeping them in Cuba, on balance, hurts U.S. interests. Guantanamo was established to be beyond the reach of U.S. law, a premise the Supreme Court rejected in Rasul v. Bush and Boumediene v. Bush. The facility is “a propaganda tool for our enemies and a distraction for our allies,” as former president George W. Bush said in a memoir in the course of explaining why his administration “worked to find a way to close the prison.” For similar reasons, closing Guantanamo remains high on Obama’s agenda.

There are no appealing solutions, but members of Congress who dispute the national security assessment of two commanders in chief should consider this: Transferring the detainees to the United States is an opportunity to strengthen the legal basis for their long-term detention, which becomes more fraught as the armed conflicts in Afghanistan and against some components of al-Qaeda wind down.

The legislation needed to bring Guantanamo detainees to the United States could supplement the military rationale for holding non-prosecutable — but very dangerous — terrorists with a form of administrative detention akin to civil commitment, one that could apply after the end of the relevant hostilities. Such a statute could prescribe the definition of dangerousness that warrants detention, the processes for determining a continued threat to public safety over time and the standards for judicial review.

This approach is, in our view, the least bad option for dealing with detainees. Keeping hardened terrorists incarcerated is essential; keeping them detained at Guantanamo Bay is untenable. The president and Congress must be partners in finding a secure solution.