How the Israel-Hamas hostage deal came together
In the days immediately after the 7 October attack on Israel, a secret cell was set up to work for the release of some 240 hostages captured by Hamas.
So began an "extremely excruciating five-week process" involving four countries, co-ordination between spy masters and high stakes presidential calls, says a senior US administration official.
Israel and Hamas have now agreed that 50 Israeli women and children will be released over a four-day pause in the fighting, in exchange for 150 Palestinian prisoners, also women and children.
As the breakthrough deal was announced, the official described to journalists how it happened.
Qatar spearheaded the effort, he said, approaching Israel and the US with a proposal to establish a cell that would work quietly and intensely on the issue. Doha acted as the main channel to Hamas, but Egypt was also part of the complex negotiating arrangement.
The first breakthrough came on 23 October, when Hamas released two American women. That was the "pilot" project, said the administration official, which "proved the concept".
After that, efforts for a larger release began in earnest.
Israel delegated the head of Mossad, David Barnea, as its negotiator and he regularly consulted the CIA chief Bill Burns on the contours of a deal.
The process was painfully protracted because messages had to be passed from Doha or Cairo to Hamas in Gaza and then back out again. And the talks were highly technical, painstakingly hammering out details on corridors, surveillance, timeframes and total numbers.
The administration official said President Joe Biden was "directly and personally" engaged, calling up the leaders of Israel and Qatar at critical times.
Mr Biden saw a hostage deal as the "only realistic path to secure a multi-day humanitarian pause in the fighting", said the official, because the Israelis made clear they would not stop their offensive for anything else.
That calculation is part of the agreement, which offers to extend the suspension of hostilities if Hamas releases more hostages.
"We also have confidence that…as we are in the pause period, additional women and children will come out," said the US official.
One of the sticking points was a failure by Hamas to clearly identify who would be in the initial group of 50. It eventually produced the information when President Biden called the Emir of Qatar and said this was a deal breaker, said the official.
Just as they appeared to be closing in on an agreement in mid-November everything stalled, he said, because communications with Hamas "went dark". He did not elaborate, but it was also around this time that Gaza ran out of fuel.
The administration official said when communications were restored it still took time to work out gaps in the very detailed agreement because of Israel and America's high level of distrust with Hamas.
He sidestepped questions about whether the hostage deal and the negotiations channel that brokered it offered a path towards ending the war.
But he said when it came to the hostages, "what I just described for the last five weeks is not going to stop. As we go through this initial phase, we're determined to get everybody home".
-bbc