The Trump administration is willing to consider dropping its insistence on pursuing the death penalty to secure British cooperation in the prosecution of two admitted Islamic State detainees accused of involvement in the executions of American, British and other foreign hostages in Syria.

The breakthrough in the long-stalled case came Wednesday, when Attorney General William P. Barr told other senior administration officials at a White House meeting that he would be willing to take the death penalty off the table if that would facilitate Britain’s sharing of crucial evidence, according to officials familiar with the matter.

The meeting came amid recent pressure from the Pentagon to get the pair, both former British citizens, out of U.S. military custody in Iraq and as FBI agents were in London and a federal prosecutor was in Iraq seeking to gather more evidence.

Barr and his predecessor Jeff Sessions had opposed removing death as a possible sentence for El Shafee Elsheikh and Alexanda Kotey, two members of a quartet of British-raised militants implicated in the beheadings of hostages and whose accents led their captives to dub them “The Beatles.” A third is in prison in Turkey. The fourth and most notorious member, Mohammed Emwazi — better known as “Jihadi John” — was killed in a U.S. drone strike in 2015.

Barr’s decision marks “a fundamental shift in the discussion,” said one senior official, who, like others, spoke on the condition of anonymity to describe internal deliberations. “This was the first breakthrough we’ve had in a long time. The sense was, ‘We’re going to get this done. We’re going to get the diplomatic piece moving.’”

Elsheikh and Kotey have been held at Al Asad air base in Iraq since October, after a Turkish invasion of northern Syria led the U.S. military to move them from a prison in Syria run by allied Kurdish forces. They were first captured by Syrian Kurdish fighters in early 2018.

Defense Secretary Mark T. Esper, hoping to limit the military’s involvement in holding detainees, had said the matter needed to be resolved by July 31. He backed off that hard deadline, but it accelerated the internal debate over what to do with the Islamic State detainees, officials said.

“DOD does not want to hold them indefinitely in Iraq or elsewhere,” a defense official said. “The temporary facility that they are currently in was never designed to house detainees for extended periods of time.” The only long-term facility is the military prison at Guantánamo Bay, Cuba, the official said, but the military does not want to add to the population there.

The United States had long maintained it was Britain’s responsibility to prosecute the pair, who were British citizens until their citizenship was stripped in 2018. But British officials have said they feared they could not mount a strong prosecution under their laws and that they lacked sufficient evidence in Elsheikh’s case.

U.S. prosecutors, for their part, believe they can bring a case. The main issue for the Justice Department is ensuring prosecutors can obtain a conviction that will send the men away for life or close to it.

“The nightmare scenario is they come here and get a short sentence or no sentence — then where would you remove them to?’’ said one national security official. “They’ve been stripped of their citizenship. . . . They’re stateless. We don’t take a lot of chances on matters like this.”

Prosecutors would like to use evidence obtained by British investigators that includes voice analysis believed to tie the two men to hostages and details on how they got to Syria. Officials also are interested in evidence showing that the duo did not make a snap decision to join the Islamic State, but rather took a long path to becoming “hardcore” Islamist militants, a department official said. Without that evidence, officials believe, it will be harder to bring a case that could result in a substantial prison sentence.

One obstacle has been a legal challenge in London. In 2018, the British government decided it would transmit the material even without a “death penalty assurance.” Elsheikh’s mother sued, arguing that would be unlawful. The Supreme Court of the United Kingdom in March agreed, but not because of the capital punishment issue. Rather, it found in a preliminary judgment that the home secretary had failed to analyze the transfer of information under Britain’s 2018 data privacy law.

“There is as yet no established principle . . . which prohibits the sharing of information relevant to a criminal prosecution . . . merely because it carries a risk of leading to the death penalty in that country,” one of the justices, Lord Robert Carnwath, wrote. A final order is pending.

The families of four American hostages are unanimous in their opposition to the death penalty, said Diane Foley, the mother of James Foley, a journalist taken hostage by the Islamic State and beheaded by Emwazi in 2014. She said there were two “major” reasons. “One is we do not want them to end up in the U.K., where they’ll get a very light sentence,” she said. “And two, we know that the U.K. evidence together with the U.S. evidence will make a much stronger case against Kotey and Elsheikh.”

A number of journalists have obtained interviews in the past year or so in which the pair discussed interactions with American and European hostages.

In an interview with The Washington Post last August, Elsheikh said that Emwazi “asked me to get emails and details about [the hostages’] family contacts, work contacts — anything that’s relevant like that — and pass them over to him.”

The email addresses were used to contact the families to conduct ransom negotiations, the men said. One or both admitted in media interviews to interactions with several Americans, including Foley; aid worker Kayla Mueller, who was also tortured and sexually abused; journalist Steven Sotloff and aid worker Peter Kassig; as well as British aid workers Alan Henning and David Haines.

“The so-called ‘Beatles’ have been in legal limbo for far too long,” said Sen. Jeanne Shaheen (D-N.H.), a member of the armed services committee. “This has been an excruciating process for the families of James Foley, Peter Kassig, Steven Sotloff and Kayla Mueller, who have fought tirelessly for a fair trial in the United States. I’ve urged Attorney General Barr to do what’s necessary in this case. Today’s news gives new hope that justice will be served.”

Asked whom he had contact with, Elsheikh said, “All of them — the famous ones, the known ones; James Foley . . . Peter, Alan, David — the major ones that were in the [beheading] videos.

“It was more like taking an email,” he said. “It was just on one side of the door, the other side of the door, what’s your email address? What’s the email address of your brother?”

He also acknowledged interacting with Mueller, who was killed in 2015, noting that Emwazi directed him to get email addresses from her as well. “So I went to her and said, how long have you been here? I don’t know how long she said. I can’t remember now.”

He said he did not torture anyone, but, he acknowledged, “I did things that were not Islamically justified. . . . Harsh treatment. Yeah. I accept that [characterization].”

Kotey, who said he did not see Mueller, said there was “some real effort to negotiate for her release,” which ended in a request for $7 million. He did not recall through whom the request was made. “This didn’t go anywhere,” he said.

Asked what he would tell the parents of the hostages, Kotey told The Post, “What could I tell them? Is sorry going to be sufficient? I’m sorry of course that that was their fate.

“Did we make mistakes? Definitely. Did I do things that I regret? Of course — like my role with the prisoners” in Syria.

“I wish,” he said, “I didn’t have anything to do with joining a jihadi organization.”