Inside a lavish clubhouse on Doha鈥檚 waterfront, tensions strained by months of fruitless back-and-forth weighed on negotiators as the hour neared 3 a.m.
On the first floor, a Hamas delegation whose leader had once evaded an Israeli airstrike that killed seven family members combed through the details of yet another proposal to halt . On the second floor, advisers to Israel鈥檚 intelligence chief, who had vowed to hunt down those responsible for the Oct. 7, 2023, attack that ignited the war, did the same.
With Qatari, U.S. and Egyptian mediators pushing for resolution, did the sides 鈥 such bitter enemies that they refused to speak directly to one another 鈥 at last have and bring dozens of Israeli hostages home?
鈥淭hey were extremely suspicious towards each other. No trust at all,鈥 said an Egyptian official involved in the negotiations, who spoke on condition of anonymity. The talks that night a week ago dragged on over disagreements about maps showing where Israel would begin withdrawing troops and its demand that Hamas provide a list of hostages who remained alive, he said.
鈥淏oth parties were looking at each word in the deal as a trap.鈥
By the time , Sheikh Mohammed bin Abdulrahman Al Thani, announced a ceasefire deal last Wednesday evening, mediators had scrambled again to defuse objections by both sides. Even then, disagreements and delays continued over the two days that followed.
But as the fighting in Gaza paused this week, from captivity and dozens of Palestinian prisoners were freed by Israel, the agreement, however tenuous, has held.
After months of deadlock, a singular moment for dealmaking
The story of how Israel and Hamas found their way to a deal stretches back over more than a year. But the timing and unlikely partners who coalesced to push negotiations across the line help explain why it finally happened now.
鈥淥ver the course of the last week all of the stars aligned finally in a way that, after 15 months of carnage and bloodshed, negotiations came to fruition,鈥 said Mehran Kamrava, a professor of government at Georgetown University's campus in Qatar.
The agreement was the product of a singular political moment, with one U.S. president preparing to hand power to another.
Both were pushing for a deal to free some 100 Israeli hostages and bring an end to a war that began with the Hamas attack that killed about 1,200 in Israel. Palestinian health officials say more than 47,000 people in Gaza have been killed in the conflict.
The health officials do not distinguish between civilians and militants, but say more than half of those killed were women and children.
In tiny but wealthy Qatar, the talks had a steward that positions itself as a go-between in a region on edge, one that hosts the largest U.S. military base in the Middle East even as it provides offices for leaders of Hamas and the Taliban. Egypt, eager to ease instability that has driven an influx of Palestinians across its border and sparked attacks on sea lanes by Houthi rebels, worked to keep the talks on track.
The circumstances partnered Sheikh Mohammed with improbable allies. Then-President Joe Biden sent Brett McGurk, a veteran Middle East hand in both Republican and Democratic administrations. Donald Trump dispatched Steve Witkoff, a Bronx-born real estate billionaire with little if any diplomatic experience, but a longtime friendship with the then-president-elect.
The deal they brought together calls for continued negotiations that could be even more fraught, but with the potential to release the remaining hostages and end a war that has destroyed much of Gaza and roiled the entire region.
Pressure mounted on Israel and Hamas
In the end, negotiators got it done in a matter of days. But it followed months of deadlock over the number of Israeli hostages that would be freed, the number of Palestinian prisoners to be released and the parameters of a pullback by Israeli troops in the embattled enclave.
In late May, Biden laid out a proposed deal, which he said had come from Israel. It drew heavily on language and concepts hammered out with Qatari and Egyptian mediators, calling for a phased agreement with continued negotiation toward a 鈥渟ustainable calm鈥 鈥 verbiage designed to satisfy both sides.
But talks had stalled even before the detonation of a bomb, attributed to Israel, in late July killed Ismail Haniyeh, the head of Hamas鈥 political bureau. And efforts by mediators to restart them were derailed when Israeli forces found the bodies of six hostages in a Gaza tunnel in August.
鈥淲hoever murders hostages does not want a deal,鈥 Israeli Prime Minister Netanyahu said.
Pressure on Hamas increased after Israeli forces killed leader Yahya Sinwar 鈥 an architect of the Oct. 7 attack 鈥 and launched a devastating offensive against Lebanon鈥檚 Hezbollah, the group鈥檚 longtime ally.
But Qatari officials, frustrated by the lack of progress, announced they were suspending mediation until both sides demonstrated willingness to negotiate.
Weeks later, Trump dispatched Witkoff, a golfing buddy whose most notable prior link to the Middle East was his $623 million sale of New York鈥檚 Park Lane Hotel to Qatar鈥檚 sovereign wealth fund in 2023.
Flying to Doha in late November, Witkoff asked mediators to lay out the problems undermining the talks, then continued on to meet officials in Israel. The talks restarted soon after, gaining ground through December.
鈥淲itkoff and McGurk were pushing the Israelis. Qatar was pushing Hamas,鈥 said an official briefed on the talks who spoke on condition of anonymity.
Cooperation between Biden and Trump advisers was key
Assigning credit for the progress depends on viewpoint.
The Egyptian official recounted the frustration of successfully pushing Hamas to agree to changes last summer, only to find Netanyahu imposing new conditions.
An Israeli official who spoke on condition of anonymity last week because the negotiations were ongoing said Sinwar鈥檚 death and Iran鈥檚 weakening influence in the region forced Hamas鈥 hand, leading to real give-and-take rather than 鈥減laying a game of negotiation.鈥
He and others close to the process said Trump's rhetoric and dispatch of an envoy had injected new momentum. The Egyptian official pointed to a statement by Trump on social media that there would be 鈥渉ell to pay鈥 if the hostages were not released, saying it had pressured both Hamas and Israeli officials to get a deal done.
And mediators said the willingness of Witkoff and McGurk -- representing leaders loathe to give one another credit for the deal 鈥 to partner up was critical.
鈥淗ow they have handled this as a team since the election, without yet being in office, has really helped close the gaps that allowed us to reach a deal,鈥 Majed Al Ansari, the adviser to Qatar鈥檚 prime minister and spokesperson for the Ministry of Foreign Affairs, said in a statement.
In early January, there was a breakthrough in the talks when Hamas agreed to provide a list of hostages it would release in the first phase of a deal, an official briefed on the talks said.
McGurk flew from Washington to Doha hours later. Witkoff followed at week鈥檚 end.
The following day 鈥 Saturday, January 11 鈥 Witkoff flew to Israel, securing a meeting with Netanyahu even though it was the Jewish Sabbath. McGurk called in. Netanyahu agreed to send the heads of Israeli intelligence and internal security back to Doha for negotiations.
That led to extended negotiations, most convening in the Qatari prime minister鈥檚 private office, that lasted late into the night.
At points, mediators shuttled back and forth between adversaries on different floors. At others, the chief negotiators for the two sides cycled separately into the prime minister鈥檚 office to hash out details.
鈥淏ut the Hamas and Israeli delegations never crossed paths,鈥 said the official briefed on the talks.
Ceasefire conditions debated up until the last moment
After the lead negotiators for each side left Sheikh Mohammed鈥檚 office late Tuesday, the work shifted to the waterfront club owned by the foreign affairs ministry, where 鈥渢echnical teams鈥 from both sides pored over the specific language, a floor apart.
鈥淯ntil late the first hours of Wednesday we were working tirelessly to resolve last-minute disputes,鈥 said the Egyptian official involved in the negotiations.
After extended discussions focused on the buffer zone Israel is to maintain in Gaza and the names of prisoners to be released, the long night ended with an agreement seemingly at hand, said the official briefed on the talks.
But with reporters gathering Wednesday evening for an announcement, 鈥渁 last-minute hiccup, last-minute requests from both sides鈥 forced a delay, the official said.
Israel accused Hamas of trying to make changes to already agreed upon arrangements along Gaza鈥檚 border with Egypt. Hamas called the claims 鈥渘onsense.鈥
A senior U.S. official involved in the talks said Hamas negotiators made several last-minute demands, but 鈥渨e held very firm.鈥
After calling the Hamas negotiators into his office, with the media and the world still anxiously waiting, the Qatari prime minister met separately with the Israelis and U.S. envoys. Finally, three hours behind schedule, Sheikh Mohammed stepped to a lectern to announce the parties had reached an agreement.
Even then, negotiations resumed the following day to wrangle with questions about final implementation of the deal and mechanisms for doing so. By the time the talks ended, it was 4 a.m.
Hours later, Israeli President Isaac Herzog voiced his hope that the deal would bring a national moment of goodwill, healing and rebuilding.
But no one can say how long it will last.
The deal calls for Israel and Hamas to resume talks just over a week from now, to work out the second phase. That is supposed to include the release of all remaining hostages, living and dead, and a permanent ceasefire. But getting there, observers say, will likely be even tougher.
鈥-
Magdy reported from Cairo, Geller from New York, and Madhani from Washington. Associated Press reporter Josef Federman in Jerusalem contributed to this story.
Sam Magdy, Adam Geller And Aamer Madhani, The Associated Press