It was one of the earliest promises Barack Obama made after entering the White House in 2009—one that had also been made often on the campaign trail—to close the U.S. Detention Center at the naval base in Guantanamo Bay, Cuba, a military prison he called a “stain” on a nation whose founding principle is the rule of law.

So just days after taking office, President Barack Obama ordered a study on how to close Gitmo, as it is known. Its existence and reputation for abuse, he argued, was a recruiting tool for terrorists and, therefore, a threat to national security.

But as his groundbreaking administration fades into history, Gitmo is outliving Obama’s good intentions.

Nearly a year ago, the president again vowed to close the center, submitting the latest among several failed plans to Congress. As expected, it again fell prey to political realities: opposition from lawmakers, the Pentagon, and leaders within his own party.

“This is about closing a chapter in our history,” Obama said in February 2016, repeating the same idealistic arguments he’s made since he announced his first White House campaign nine years earlier: it’s expensive, unnecessary, and contradicts U.S. ideals.

“Keeping this facility open is contrary to our values. It undermines our standing in the world,” he told reporters gathered in the White House’s East Wing. “It is viewed as a stain on our broader record of upholding the highest standards of the rule of law.”

On cue, House Speaker Paul Ryan, the top Republican in Congress, poured a bucket of cold water—again—on Obama’s plan to bring Gitmo’s remaining inmates, ones who can’t be repatriated or stand trial, to the U.S.

“After seven years, President Obama has yet to convince the American people that moving Guantanamo terrorists to our homeland is smart or safe,” Ryan said in a statement. “It is against the law—and it will stay against the law—to transfer terrorist detainees to American soil. We will not jeopardize our national security over a campaign promise.”

Though there was plenty of partisan topspin in his statement, experts say Ryan’s response encapsulates why some repressive regimes Washington has criticized, including Russia, say Gitmo is synonymous with American do-as-Isay hypocrisy. It’s also why experts say the world’s most infamous prison will probably exist for years, perhaps decades, beyond Obama’s tenure.

The president’s crusade to darken Gitmo, a facility that costs U.S. taxpayers nearly half a billion dollars each year, is hamstrung by a complex web of conflicting priorities. That includes wary lawmakers and anxious voters more worried about threats from locking up suspected terrorists in U.S. prisons—no matter how secure—than they are about Guantanamo as a beacon for anti-American terrorists.

The hurdles, however, also include the facility’s ugly legacy of detainee abuse—actions that all but invalidate criminal evidence against some of them—and its unstable, built-on-the-fly justice system, which can’t guarantee speedy trials or meet constitutional standards of jurisprudence.

Others, however, say the president’s failed promise to close Gitmo stems from nearly a decade of backbiting within segments of the Obama administration, including the White House, the Pentagon, and the State Department, as well as Obama’s internal battle among his ideals, his duties as commander in chief, and his reluctance to use political muscle on an unpopular decision.

“It’s absolutely insane,” says Chris Anders, deputy director of the American Civil Liberties Union’s Washington Legislative Office, ticking off arguments for closure, including Guantanamo’s $455 million annual bill for taxpayers and Russian President Vladimir Putin’s use of it as a rebuttal to U.S. criticism of totalitarian states like his own.

“There are good reasons to close it. It hasn’t closed because of political infighting and score-settling,” Anders says. “It’s basically a question of political will and courage.”

"Keeping this facility open is contrary to our values. It undermines our standing in the world. It is viewed as a stain on our broader record of upholding the highest standards of the rule of law." President Barack Obama

But the administration says closingGuantanamo is an imperative that has bipartisan support.

The White House “worked for several months” to examine options “and finalize a comprehensive plan to responsibly and securely close the detention facility,” says Emily Horne, a White House National Security Council spokeswoman, in an email  interview. “As the president said in his remarks in February, keeping this facility open is contrary to our values. It undermines our standing in the world. It is viewed as a stain on our broader record of upholding the highest standards of rule of law.”

Situated on a 45-square-mile U.S.naval base on land leased from Cuba since 1903, Guantanamo was initially  intended to become a facility for “the worst of the worst”: men captured on the post-9/11 battlefields in Iraq and Afghanistan, fighters considered too dangerous for transfer to federal prisons.

They include Mohammed al Ansi,described as Osama bin Laden’s former bodyguard; Khalid Ahmad Qasim, a suspected Al-Qaida subcommander; and Salman Yahya Hassan Muhammad Rabeii, who has “expressed hatred for the U.S.” and “has expressed an interest in becoming a martyr,” according to a military assessment.

Almost immediately after Gitmo opened, however, there were problems.

Human rights advocates saidthe center violated the Geneva Conventions for prisoners of war.  Civil liberties groups argued that indefinite detention without charge, standard operating procedure at the height of the wars in Iraq and Afghanistan, was unconstitutional. Dozens of inmates were found to have either been handed over to the U.S. military by warring third parties or were caught in the wrong place at the wrong time; others reported military guards and CIA interrogators tortured them into confessions of hostile or terrorist acts.

As the wars ground on, the detainee population grew to 780 by the mid-2000s. What had been an open-air prison camp in the Caribbean was subsequently transformed into a hardened permanent facility, more like a standard, high-security prison than a military installation.

White House attorneys and top Pentagon brass scrambled to create a justice system for inmates like suspected 9/11 mastermind Khalid Sheikh Mohammed—men who weren’t traditional POWs or members of an armed force. They came up with military tribunals, a jury of three to seven armed forces officers hearing evidence with a presiding judge, also in uniform.

Under the procedures, a defendant “would receive many, but not all, of the due process protections” guaranteed in a U.S. court, according to the Constitutional Rights Foundation. While they include the presumption of innocence and the right to defense counsel, the tribunals are closed to the public, the prosecution need only convince two of three fellow military officers for a conviction, and a defendant’s right to appeal is sharply limited.

Critics say the commissions are slow and ineffective, taking an average of eight years to conclude. Military prosecutors and defense lawyers wrestle over mountains of classified evidence, including statements made under torture. Just three detainees have been convicted in 13 years, while Mohammed has been on trial, on and off, since 2007.

By comparison, Richard Reid, the so-called “Shoe Bomber,” and Umar Farouk Abdulmutallab, who tried to detonate an underwear bomb, both were tried and convicted in federal court not long after their arrests. Though many of his Muslim comrades in arms ended up in Gitmo, John Walker Lindh, an American captured in Afghanistan fighting with the Taliban, is doing time in a federal prison under a plea deal.

“The problem is [military commissions] are a broken system—it’s a made-up form of justice,” the ACLU’s Anders says. The military judges “are doing their best” to ensure fair trials, he says, but they—the defense lawyers and the prosecutors—all are navigating uncharted legal territory that may not survive a Supreme Court challenge.

Under pressure, the Bush administration cleared and released more than 500 inmates, pushing through objections in Congress and negotiating with other countries to accept former detainees when their home countries, fearing terrorism, refused. And when he succeeded President George W. Bush in 2009, Obama moved to make good on his promise of closing Guantanamo with all deliberate speed.

But when the new president proposed transferring some Gitmo detainees into the same system that dealt with Reid, Abdulmutallab, and Lindh, Congress balked, including most Republicans and many Democrats, such as Senator Harry Reid, a top Obama ally.

Bravo, said voters. A CNN/ORC poll conducted early this year, just after Obama submitted his latest plan, found that 56 percent think closing Guantanamo Bay is a bad idea, while 40 percent support it. But overall support tilts to one side, with 83 percent of Republicans saying it shouldn't be closed, up sharply from 76 percent in 2015. Meanwhile, the already-low odds that Congress would go along with Obama and shut down Gitmo sank to almost nil when the GOP won the House in 2010 and the Senate in 2014.

Adding to the opposition was a new intelligence report late last year that found some repatriated inmates had returned to the battlefield.

"There are good reasons to close it. It hasn’t closed because of political infighting and score-settling. It’s basically a question of political will and courage." Chris Anders, Deputy Director of the American Civil Liberties Union's Washington Legislative Office

Reacting to the news, the House in September voted to block the president from transferring any of the remaining Guantanamo Bay detainees out of the facility, even banning him from sending them to foreign countries who’ve agreed to take them. The bill probably won’t go far, but it was another public reminder that Obama’s pledge to close Gitmo had been, in the most favorable analysis, an uphill battle with few political allies.

The report in question comes from the office of the Director of National Intelligence, which confirmed that two detainees released since Obama took office have returned to “terrorist activities.” Further, the report says, nine of 161 inmates released since January 2009, whose identities are classified, are now supporting terror groups, and 11 are “suspected” of fighting U.S.-led forces in Iraq, Afghanistan, and Syria.

But Horne, the White House spokeswoman, says that’s the exception, not the rule. Releases happen, she says, only after “the best judgment of U.S. government experts, including counterterrorism, intelligence, and law enforcement professionals” determine that the detainee isn’t likely to become a threat.

“Since President Obama signed Executive Order 13492, less than six percent of former detainees have been confirmed, and less than seven percent of former detainees are suspected of reengaging in terrorist activity,” Horne says. “The rigorous interagency review process put in place by this administration has resulted in a measured, responsible, and thoughtful approach to transfers that places the safety of Americans paramount.”

Nevertheless, there are at least 43 inmates who pose the thorniest challenge: intelligence reports declare they’re too dangerous for release, but they can’t be legally tried for various reasons, including evidence against them that was obtained through torture, which is inadmissible in court.

Though indefinite detention violates both the Geneva Conventions and the Constitution, the Bush administration argued that it didn’t apply to Guantanamo; rather than POWs from a national army, the camp houses stateless “unlawful enemy combatants” who aren’t considered prisoners of war and aren’t on U.S. soil.

It’s clear, however, that the “forever detainees” probably aren’t going anywhere: the military is preparing to care for Gitmo’s remaining population over the long haul, and Obama has quietly acknowledged they may never be freed.

“There’s going to be a certain irreducible number that are gonna be hard cases, because we know they’ve done something wrong and they are still dangerous,” he told CNN in 2014. “But it’s difficult to mount the evidence [against them] in a traditional [federal] court. So we’re going to have to wrestle with that.”

In September, a Guantanamo spokesman told The Miami Herald that the base is spending $2.6 million renovating its infirmary to include cardiac equipment, an MRI unit, and a dialysis machine. With 10 detainees between ages 50 and 60, the spokesman said, the investment is an attempt to answer the “broader questions raised by an aging population” that can’t be treated in America.

Last summer, an investigation by Connie Bruck, a reporter for The New Yorker, found that, on election night in 2008, elated prisoners and staff chanted Obama’s name and held an impromptu party. But a recalcitrant Congress, White House divisions, and high-ranking Pentagon skeptics quickly quashed the new administration’s plan for an orderly, bipartisan shutdown.

“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,” Bruck wrote. “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.’”

But the ACLU’s Anders says  the buck also stops with Obama: he didn’t quash the West Wing infighting, didn’t use his commander-in-chief powers to bring the Pentagon to heel, and when faced with annual military funding bills in which lawmakers inserted
language blocking Guantanamo’s closure, the veto pen stayed in his pocket. 

“That’s why it has stayed open,” Anders says, “and I think that it will  survive his presidency.”

Obama also came to understand that Gitmo, which one government attorney described as the legal equivalent to outer space, will do serious damage to his legacy. White House officials are scrambling to meet the deadline of January 20, Obama’s last day on the job, and Obama himself is mindful of his own missed opportunities

Last March in Cleveland, a seventh grader “asked what advice [Obama] would give himself if he could go back to the start of his Presidency,” Bruck writes in The New Yorker. “Obama said, ‘I think I would have closed Guantanamo on the first day.’ But the politics had got tough, he said, and ‘the path of least resistance was just to leave it open.’”