The President and his aides are keenly aware of the short time—six months—left to fulfill his pledge to close the prison. Illustration by Brad Holland

At the Guantánamo military prison—a desolate place near the eastern tip of Cuba—detainees began a chant that grew louder as it spread: “Obama! Obama! Obama!” It was Election Night in November of 2008, and the returns had made it clear that Barack Obama had soundly defeated John McCain. The chant echoed from blocky concrete buildings arranged into camps, where “compliant” detainees watched television and took classes, and “non-compliant” ones passed their time in twelve-by-eight-foot cells. The sound of the chant stopped short of the top-secret Camp 7, where the C.I.A. held “high value” detainees, including five men charged with participating in the attacks of September 11, 2001. But at Camp Justice, which housed visiting defense lawyers and military prosecutors in facing rows of tin sheds, the lawyers formed a chain and mamboed through the prosecutors’ side, chanting their own refrain: “Hey, hey . . . goodbye!” The prosecutors evidently took offense: a shoving match broke out.

When Obama began his first Presidential campaign, in 2007, the idea of closing the prison facilities at Guantánamo seemed to be gathering political force. Both Hillary Clinton, Obama’s main opponent in the Democratic primaries, and McCain, the Republican nominee and a former prisoner of war in North Vietnam, endorsed it. But Obama spoke about the issue with particular passion. “In the dark halls of Abu Ghraib and the detention cells of Guantánamo, we have compromised our most precious values,” he said. Guantánamo has been the scene of dubious, lengthy detainments, force-feedings, sleep deprivation, stress positions, vicious beatings, and other forms of torture, and yet in 2005 Vice-President Dick Cheney dismissed accusations that the camp was, in the words of one Red Cross report, a place of “humiliating acts.” He said of the prisoners, “They’re living in the tropics. They’re well fed. They’ve got everything they could possibly want. There isn’t any other nation in the world that would treat people who were determined to kill Americans the way we’re treating these people.”

For Obama, closing Guantánamo was an essential break with the Bush-Cheney era. On January 22, 2009, his second day in office, he issued an executive order, directing that the prison be shut down within a year. When detainees got the news, they shouted to the guards, “Have you heard? We’re getting out of here!”

Guantánamo, which has held as many as seven hundred and seventy-nine prisoners, now houses just seventy-six. But it remains open, at a cost of $445 million last year—an expensive reminder that the United States, contrary to the ideals of its judicial system, is willing to hold people captive, perhaps for life, without a trial. For Obama, it is also painful evidence of the difference between the campaign promises of a forty-six-year-old aspirant and the realities of governing in a bitterly polarized time. Last March, when he made an appearance in Cleveland, Ohio, a seventh grader asked what advice he would give himself if he could go back to the start of his Presidency. Obama said, “I think I would have closed Guantánamo on the first day.” But the politics had got tough, he said, and “the path of least resistance was just to leave it open.”

Obama may yet close Guantánamo before he leaves office, but his failure to do so in nearly eight years as President has drawn criticism from a vast number of people who otherwise support him: liberals, centrists, officials in his own Administration. Obama and his aides are keenly aware of the unfulfilled promise, and of the short time—six months—left to them. Susan Rice, the national-security adviser, has spoken of the urgency around closing the prison: “I can’t say with certainty that we’re one hundred per cent going to get there, but I can tell you we’re going to die trying.”

In recent months, Guantánamo has been swarmed by defense lawyers trying to clear cases. The rush is inspired partly by Obama’s concerns about his legacy and partly by political calculations, as the Presidential election approaches. Hillary Clinton, who will accept the Democratic nomination this week, in Philadelphia, has vacillated on Guantánamo. But as Secretary of State, Administration sources say, she was far more willing than Obama to take political risks to get it closed.

Donald Trump has vowed to keep the prison open, and to “load it up with some bad dudes.” According to a leaked memo obtained by CNN, those prisoners will include American ISIS supporters—which, critics say, will likely mean American Muslims, deprived of their constitutional rights. “I would bring back waterboarding, and I’d bring back a hell of a lot worse than waterboarding,” Trump has said, adding, in other appearances, “Don’t tell me it doesn’t work—torture works,” and “If it doesn’t work, they deserve it anyway, for what they’re doing to us.”

In public remarks, Obama has usually blamed Congress for his failure to close the prison. But months of reporting revealed a highly charged series of political maneuvers, involving nearly every part of the Administration. The attempt to close the prison has entailed tense negotiations with foreign officials, heated confrontations during meetings in the White House Situation Room, and, especially, a long-running fight with the Pentagon, which outplayed Obama for years. For those who worked to implement his policy, often without support, the frustrations were acute. “You need White House backing,” a senior Administration official told me. “If something went wrong, the risk was all ours. Gitmo was a potential career-ender.”

The Guantánamo detention center was built on a forty-five-square-mile U.S. naval base, situated on land that has been leased from Cuba since 1903. When the prison opened, in 2002, it seemed like a rogue intelligence agent’s dream—an offshore facility, free from U.S. laws, where foreign prisoners could be held without access to family or lawyers, and interrogated however their jailers saw fit. Prisoners were brought there after 9/11 to remove any threat they might pose and to provide intelligence, but there was little expectation that they would be criminally prosecuted, so scant attention was given to the kind of evidence-gathering that would be required in court.

Despite persistent rhetoric from figures like Defense Secretary Donald Rumsfeld, who described the detainees as “the worst of the worst,” some members of the Bush Administration felt ambivalent about Guantánamo. The overwhelming majority of detainees were not terrorist leaders but low-level foot soldiers, along with some men who were just unlucky. Many had been turned over to the American military by local warlords for a bounty of as much as twenty-five thousand dollars a head. A leaflet distributed by the U.S. in Afghanistan and Pakistan promised that anyone who handed in an “Arab terrorist” would receive “enough to feed your family for life.”

Major General Michael Lehnert, the first commanding officer of Guantánamo, quickly understood the complexities of the situation. “Some of these people had simply been turned over with essentially a made-up rap sheet,” Lehnert told me. “The problem we faced was that almost everybody that got there said they were innocent and they’d simply been studying in a madrassa,” an Islamic religious school. “Some of them had been, there is no doubt in my mind,” he said. “And others were fairly senior in the Taliban or Al Qaeda. These types of things should have been sorted out in Afghanistan, with Article 5 hearings—the usual procedure followed under the Geneva Conventions to sort out ‘the sheep from the goats.’ That didn’t happen, largely because the decision was made that the Geneva Conventions did not apply in this conflict.”