GUANTANAMO BAY, Cuba - Holding Nazi war criminal Rudolf Hess as the lone prisoner in Germany’s Spandau Prison in 1985 cost an estimated $1.5 million in today’s dollars. The per-prisoner bill in 2012 at the “supermax” facility in Colorado, home to some of the highest-risk prisoners in the United States, was $78,000.

Then there is Guantanamo Bay, where the expense now works out to about $13 million for each of the 40 prisoners being held there.

According to a tally by the New York Times, the total cost last year of holding the prisoners — including the men accused of plotting the Sept. 11, 2001, attacks — paying for the troops who guard them, running the war court and doing related construction, exceeded $540 million.

The cost of $13 million per prisoner almost certainly makes Guantanamo the world’s most expensive detention program. And nearly 18 years after the George W. Bush administration took a crude compound called Camp X-Ray and hastily established it as a holding station for enemy fighters picked up in the war on terrorism, it has taken on a sprawling and permanent feel, with the expense most likely to continue far into the future.

Because of the relative isolation of its location on a U.S. Navy base on Cuba’s southeast coast, the military assigns around 1,800 troops to the detention center, or 45 for each prisoner. The troops work out of three prison buildings, two top-secret headquarters, at least three clinics and two compounds where prisoners consult their lawyers. Some also stand guard across the base at Camp Justice, the site of the war court and parole board hearing room.

The prison’s staff members have their own chapel and cinema, housing, two dining rooms and a team of mental health care workers, who offer comfort dogs.

Judges, lawyers, journalists and support workers are flown in and out on weekly shuttles.

The 40 prisoners, all men, get halal food, access to satellite news and sports channels, workout equipment and PlayStations. Those who behave — and that has been the majority for years — get communal meals and can pray in groups, and some can attend art and horticulture classes.

The estimated annual cost of $540 million covers the 12-month period that ended last Sept. 30 and does not include expenses that have remained classified, presumably including a continued CIA presence. But the figures show that running the range of facilities built up over the years has grown increasingly expensive even as the number of prisoners has declined.

A Defense Department report in 2013 calculated the annual cost of operating Guantanamo Bay’s prison and court system at $454.1 million, or nearly $90 million less than last year. At the time, there were 166 prisoners at Guantanamo, making the per-prisoner cost $2.7 million.

The 2013 report put the total cost of building and operating the prison since 2002 at $5.2 billion through 2014, a figure that now appears to have risen to past $7 billion.

Guantanamo Bay, said Capt. Brian L. Mizer, a Navy lawyer who has represented detainees at the prison across a decade, has “America’s tiniest boutique prison, reserved exclusively for alleged geriatric jihadists.”

Guantanamo has held a cumulative total of about 770 foreign men and boys as wartime prisoners at different times, with the prison population peaking at 677 in 2003. The last prisoner to arrive came in 2008.

The Bush administration released about 540 of the detainees, mostly by repatriating them to Pakistan, Afghanistan and Saudi Arabia. Then the Obama administration released another 200 through third-country resettlement or repatriation. President Donald Trump ran for office on a promise to keep the prison open and possibly send more “bad dudes” there, though no one new has arrived since he took office.

It has been clear for years that there is no political consensus to end detention operations at Guantanamo Bay and move the remaining prisoners to the United States.

The growing costs represent the bill for that choice. And with the military justice system moving at a crawl, the cost is a particular sore spot for critics of the prison.

“I don’t think there’s any need to have an incredibly expensive facility down at Guantanamo housing, you know, 40 people,” Rep. Adam Smith, D-Wash., the chairman of the House Armed Services Committee and a longtime proponent of closing the prison, said in June. “So ultimately I think they should be transferred here.”

Comparing Guantanamo with more traditional prisons is tricky. Federal prisons employ civilians who pay for their own food and health care, drive their own cars, live in their own homes and amuse themselves on their days off.

The Defense Department provides all of those things for the military personnel at Guantanamo, mostly National Guard forces and reservists who come and go on nine-month rotations. Soldiers handle the prisoners on the cell blocks or in transit, monitor them by security camera and patrol perimeters.

The guard staff is so large, a former warden said, for the same reason the detention center was located here in the first place: It is isolated.

“I don’t have the state police,” Col. David Heath, then the Joint Detention Group commander, essentially the warden, told reporters in 2016. “I don’t have the county sheriff. I don’t have anybody else to call to help me keep things under control here.”

The prison’s uniformed staff members also include a Coast Guard unit that patrols the waters below the cliff top prison zone; Navy doctors, nurses, psychological technicians and corpsmen; a unit of Air Force engineers; lawyers, chaplains, librarians, chaperones and military journalists. Each has layers of commanders who oversee their work and manage their lives at Guantanamo.

In addition to the troops, the prison employs Defense Department contract linguists, intelligence analysts, consultants, laborers, information technology professionals and other government workers. In 2014, that civilian workforce numbered 300.

The detention operations are within the Guantanamo Bay naval station, which has 6,000 residents, including the more than 2,000 troops and civilians assigned to the detention operation. The naval base has its own budget separate from the costs of the prison and the court.

The restricted areas that house the prison function like a base within a base, behind a security checkpoint that is about a seven-minute drive from the naval station’s McDonald’s. The court, managed by a different military authority, is a five-minute drive from the McDonald’s in a different direction.

The detention center zone has its own headquarters, motor pool, mental health services, minimart, and public affairs team, which recently referred to the troops assigned there as “warfighters.”

With the exception of an Army security force of fewer than 300 soldiers who live in prefabricated containers within the prison zone, most troops who work in the prison complex live on the naval base.

Some cellblock guards live in the Tierra Kay townhouses near the trooper clinic, the quickest commute to the zone. Most commanders live deeper on the base, in two-bedroom homes in an area called Windward Loop.

And hundreds of enlisted soldiers live in the kind of trailer park familiar to forces who served in Iraq or Afghanistan. The troops call them CHUs, for containerized housing units. Each unit has two bedrooms, one toilet and a shower and is within walking distance of the Navy base’s baseball field, bars, commissary and cafeteria.

In 2018, Congress approved spending $115 million on a dormitory-style barracks complex to replace trailer housing for 848 troops. But no contract has been awarded, construction has not yet begun and Navy spokesmen could not provide the target completion date.

In contrast to the naval base, the prison zone resembles a battlefield-style operation. It has watchtowers and Humvees and dirt roads and a series of permanent and semipermanent prison facilities, all of them built since 2002 and surrounded by razor wire that rusts in the salt air.

The 40 prisoners’ cells are in three different buildings, but during the day, the inmates can be scattered across seven or eight different sites — the war court, a hearing room for parole-like board meetings, the base hospital and two adjacent compounds where the prisoners consult their lawyers.

Consolidation through new construction would allow the prison to reduce its staff at one site by 74 troops, saving $8 million in “manpower costs,” Rear Adm. John Ring, the former prison commander, told reporters in April, suggesting a per-troop cost at the facility of $108,000.

The Defense Department concluded that taxpayers spent $380 million for Guantanamo’s detention, parole board and war court operations, including construction, in the 2018 fiscal year, or more than $9 million per prisoner.

Adding those “manpower costs” of $108,000 a year for each of the 1,800 troops brings the total figure to more than $540 million.

Even in the unlikely event that more prisoners were sent to Guantanamo, the per-prisoner cost would not necessarily decline. Commanders said that adding more detainees would require more military police.

The base, and the prison and court facilities within it, functions in a state of isolation, totally cut off from the Cuban economy.

It operates in some respects like an aircraft carrier at sea, even desalinating its own water with fuel brought in by tanker.

Nearly all of the base supplies — like family household shipments, frozen pizza dough for the bowling alley food court and rental cars for the base commissary — arrive twice monthly on a government contract barge from Florida. A refrigerated cargo plane brings fresh fruit and vegetables weekly.

Commanders have also attributed some costs to the wear and tear on the prison staff facilities. Guantanamo is hot, humid, whipped by tropical storm winds and the occasional hurricane.

In the past two years, the military hired contractors to do $15 million in repairs to the guards’ townhouses, a $14.5 million expansion of the war court compound, $1.5 million in repairs to the trooper clinic, more than $1 million renovating air conditioning and ventilation in the officers’ homes, $648,000 on erosion and climate control around the general population prison complex, $273,110 to replace a latrine near a now defunct kitchen and $47,690 to renovate the prison staff chapel.

Defense Department contractors who bid for these job have to factor in the cost of bringing in their own workers and equipment, including bulldozers and buzz saws. As a measure of how expensive it is to do construction here, the projected cost of a new prison for 15 former CIA captives that was first proposed during the Obama administration has jumped from $49 million to $88.5 million in five years.

Other costs involve the military commissions, where eight of Guantanamo’s 40 prisoners are charged with terrorism or war crimes, six in death penalty cases that began in 2011 and 2012.

The military commissions costs, based on congressional documents, exceeded $123 million in 2018.

Each hearing requires a major movement of people and materials from the United States to the base on passenger planes the Pentagon charters for $80,000 one way. There were 52 such commercial flights in 2018 between Joint Base Andrews, outside Washington, and Guantanamo. Until the start of a trial — the trial of the men accused of plotting the Sept. 11 attacks is scheduled to begin in early 2021 — the majority of the legal work is carried out in a warren of rental offices near the Pentagon, some of which have sat empty for more than a year as they await security upgrades.

The troops have a multitiered health care system. The trooper clinic cares for the guards’ basic needs. Serious medical matters are handled by the base’s small community hospital. More complicated cases, or soldiers who require specialized tests, are sent to Navy health care facilities in Jacksonville, Florida, or Bethesda, Maryland.

In 2017, the Navy shipped a portable MRI machine to Guantanamo to scan the brains and bodies of detainees awaiting death penalty trials, by order of a military judge, who granted a request by a defense team to do the tests and hire experts to look for damage done by torture. But because there is no on-site technologist to run it, an off-island contractor has had to shuttle to the base to service it.

Health care for detainees is handled by a group of about 100 Navy doctors, nurses and medics who also staff the trooper clinic. The 100-member medical team had a $4 million budget last year.

But when a prisoner needs specialized care, such as a colonoscopy and spine surgeries, the military brings special teams to Guantanamo at a cost the military declined to disclose.

It is all part of the mix and match nature of serving at Guantanamo, where troops staffing the prison on nine-month tours get imminent-danger and hardship-duty pay — and on their time off can go scuba diving or take leave and bring friends and family to the Navy base for vacations.