GOP Sen. Lindsey Graham confirmed Monday he is working with White House Chief of Staff Rahm Emanuel to break the logjam on closing the military prison at Guantanamo Bay, Cuba, and bringing the prisoners to trial.

The South Carolina senator said that in a series of meetings and phone calls over the last “several weeks,” he has pressed to establish a new national security court that would keep most Guantanamo detainees out of the federal courthouse. He expressed confidence that he could strike a deal to extend some measure of habeas corpus rights to prisoners detained on terrorism charges and to draft a “law of war” statute that ensures no one can be detained on the whim of the executive branch without oversight or judicial recourse.

A breakthrough on those issues could lead to agreement on trials for Guantanamo prisoners outside the federal court system, he said.

“I think Rahm has always understood Gitmo is like fly paper,” Graham said, explaining that every politician who has approached the prison has ended up stuck. Closing it is “the pragmatic thing to do in the overall war [on terror]. It’s an image problem for the United States and a practical problem, having a jail where presidents don’t want to send anyone. But a solution has got to be bipartisan. There’s no way the Democratic Party is going to walk off a political cliff here without Republican support, nor should they.”