By Yolande Knell & David Gritten
BBC News, in Jerusalem and London
Israel and Hamas have reached a deal to exchange 50 of the hostages held in Gaza for a four-day pause in fighting.
The agreement should also see 150 Palestinians held in Israeli jails released and a significant increase in humanitarian aid allowed into Gaza.
Mediator Qatar has said the pause will start at 07:00 local time (05:00 GMT) on Friday and the first group of 13 hostages will be released at 16:00.
The US president has said the deal will end the hostages’ “unspeakable ordeal” and “alleviate the suffering of innocent Palestinian families”.
The Israeli government has vowed to complete its war to eliminate Hamas and return the rest of the more than 200 hostages who Hamas gunmen kidnapped during a cross-border attack on southern Israel on 7 October in which 1,200 people were killed.
Hamas – which Israel, the US and other Western powers class as a terrorist organisation – has said the deal will give Palestinians time to recover after an intense Israeli air and ground assault which its government in Gaza has said has killed more than 14,500 people.
Which hostages will be released?
Their names have not been published, but we do know that they will all be women and children.
After Israel’s coalition government signed off on this deal early on Wednesday, Prime Minister Benjamin Netanyahu’s office said in a statement that “at least 50 hostages – women and children – will be released over four days, during which a pause in the fighting will be held”.
It also offered Hamas an incentive to release more, saying: “The release of every additional 10 hostages will result in one additional day in the pause.”
That clause is important for the hostages’ families, some of whom had previously told the BBC that they did not want to see a partial deal.
The 50 hostages, expected to be released in four batches, will be Israeli nationals or dual nationals, rather than foreigners.
A spokesman for Qatar’s foreign ministry told reporters in Doha on Thursday afternoon that the first group of hostages to be released on Friday would comprise 13 children and women, some of them elderly. “Hostages from the same family will be put together in the same batch,” Majid al-Ansari noted.
He also said a list of names for the first group had been handed to Israel’s Mossad intelligence agency to facilitate the implementation of the deal.
Mr Netanyahu’s office later confirmed that officials were “checking the details of the list and are currently in contact with all of the families”.
A senior US official said on Wednesday that at least three American citizens – including three-year-old Avigail Idan, an Israeli dual national whose parents were killed in Kibbutz Kfar Aza – would be among the 50 hostages.
A senior Israeli official said on Tuesday afternoon that Hamas could also unilaterally release the 26 Thai nationals believed to be among the hostages.
The International Committee of the Red Cross (ICRC) has been designated to receive the hostages in Gaza, as its staff did when Hamas freed two Israeli-American women and two Israeli women last month.
On Wednesday night, Mr Netanyahu quoted the agreement as saying that the ICRC would also “be allowed to visit the remainder of the hostages and to give them required medications”. However, Mr Ansari was unable to disclose whether that was the case.
Israeli forces operating inside Gaza have also rescued one female soldier and recovered the bodies of two other female hostages – a soldier and a civilian.
The Israeli government said it would “continue the war in order to return home all of the hostages, complete the elimination of Hamas and ensure that there will be no new threat to the State of Israel from Gaza”.
What will happen in Gaza during the pause?
A longer Hamas statement issued on Wednesday morning gave more details of what Israeli military action was expected to cease for the duration of what it called a “hudna”, or temporary truce.
It said all drone and Israeli aircraft activity was expected to stop for four days in the south of Gaza.
But in the north – which has been the main target of Israeli operations to dismantle Hamas – the same will only hold between 10:00 and 16:00 local time (08:00-14:00 GMT) each day.
Israeli troops and tanks are expected to remain in their positions inside Gaza during the four-day pause, but the Hamas statement said Israeli forces would not attack or arrest anyone.
Mr Ansari said there would be “a comprehensive ceasefire” in the north and south, while Qatar’s chief negotiator, Minister of State Mohammed al-Khulaifi, told Reuters news agency that there would be “no attack whatsoever, no military movements, no expansion, nothing”.
For Palestinians in Gaza, 1.7 million of whom have fled their homes according to the UN, a respite in the brutal fighting cannot come soon enough.
The deal will allow 200 lorries carrying aid, four fuel tankers and four lorries carrying cooking gas to enter Gaza via Egypt’s Rafah crossing on each of the four days.
But it is understood that the boost in fuel – desperately needed for hospital generators, water desalination and sewage facilities – will only last for as long as the pause.
Mr Ansari said the additional aid would start going into Gaza as soon as possible after the pause began on Friday morning and there was a period of calm that made it safe for humanitarian workers.
Israel cut off electricity and most water, and stopped deliveries of food, fuel and other goods to Gaza in retaliation for Hamas’s attack.
It allowed 1,399 lorryloads of humanitarian supplies to enter via Egypt between 21 October and 21 November, compared to a monthly average of 10,000 before the war, according to the UN.
It blocked all fuel deliveries until last week, saying it could be stolen by Hamas and used for military purposes.
And although the deal will allow people in Gaza safe passage from north to south, it will not permit the hundreds of thousands of displaced people from the north to return home.
Who are the Palestinian prisoners?
Hamas said that the deal would also see 150 Palestinian prisoners – all women and children – released by Israel.
The Israeli government statement did not mention that, but on Wednesday morning its justice ministry published a list in Hebrew of the names of 300 prisoners eligible for release as part of the deal – based on the possibility that Hamas will agree to free 50 more hostages.
The list comprises 123 boys aged between 14 and 17, one 15-year-old girl, 144 18-year-old men, and 32 women aged between 18 and 59. Most are remanded in custody while awaiting trial on charges that range from stone-throwing to attempted murder.
The reason the list had to be published is because of a legal formality in Israel. Ahead of any prisoner release, Israeli citizens must be allowed 24 hours to make an appeal to the Israeli Supreme Court.
Mr Ansari said Qatar could not disclose any details about the Palestinian prisoners or how many would be freed on the first day. But he did suggest that the releases would happen at the same time as those of the hostages in Gaza.
Israel is currently holding about 7,000 Palestinians accused or convicted of security offences, according to Israeli and Palestinian rights groups. Almost 3,000 Palestinians are reported to have been arrested in the occupied West Bank and East Jerusalem, where violence has also surged, since 7 October.
Hamas’s statement ended by saying the deal aimed to “serve our people and strengthen their steadfastness in the face of aggression”.
It also warned: “Our fingers remain on the trigger, and our victorious fighters will remain on the look out to defend our people and defeat the occupation.”
How will the deal be monitored?
Qatar’s foreign ministry spokesman said an operations room in Doha would maintain real-time lines of communication with Israel, the Hamas political office, and the ICRC, so that any possible breach is “communicated immediately to both sides and there is a way to walk back from it”.
The most important thing was to “make sure that the environment in which the hostage transfer will happen will be a safe one”, he added.
Mr Ansari said Qatar hoped to extend the temporary truce beyond the initial four days by securing the release of more hostages. He also expressed hope that it would serve as a “proof of concept for further de-escalation measures… and a more sustainable truce in Gaza”.