Initially, the Israeli aerial attack on the Hamas delegation in Qatar seemed like another escalation that drove the hope of peace further away.
This strike on 9 September violated the territorial integrity of an US partner and risked widening the hostilities into a broader regional conflict.
Negotiations seemed to be in ruins.
Instead, it turned out to be a key moment that has led in a agreement, declared by President Donald Trump, to release all captives still held.
This is a goal that he, and President Joe Biden previously, had pursued for almost 24 months.
It is just the initial phase towards a more durable peace, and the details of disarming Hamas, administering Gaza and full Israeli withdrawal remain to be worked out.
But if this deal holds, it could be Trump's defining accomplishment of his second term - one that escaped Biden and his administration.
Trump's unique style and crucial relationships with Israel and the Arab world seem to have contributed in this breakthrough.
However, as with many diplomatic achievements, there were also elements at play beyond the control of both leaders.
Publicly, Donald Trump and Israeli Prime Minister Benjamin Netanyahu are all smiles.
Trump often states that Israel has no greater ally, and the Israeli leader has called him as Israel's "most supportive friend in the US presidency". And these positive statements have been matched by actions.
During his initial time in office, Trump moved the US embassy in the country from its former location to the contested capital and abandoned a long-held US position that Jewish communities in the occupied territories are illegal, the view under international law.
After the Israeli military began its air strikes against Iran in June, Trump ordered US bombers to target the nation's nuclear enrichment facilities with its largest non-nuclear weapons.
Those public demonstrations of backing may have allowed the president the leeway to apply more pressure on Israel behind the scenes. According to reports, Trump's negotiator, Steve Witkoff, browbeat Netanyahu in late 2024 into accepting a temporary ceasefire in exchange for the freeing of some hostages.
After Israel launched strikes against Syrian forces in the summer, including bombing a place of worship, the US president urged his counterpart to change course.
Trump displayed a degree of determination and pressure on an Israeli prime minister that is virtually unprecedented, according to Aaron David Miller of the Carnegie Endowment for International Peace. "It's unheard of of an US leader directly instructing an Israeli leader that you're going to have to comply or else."
Joe Biden's relationship with Netanyahu's government was consistently more tenuous.
The Biden team's "close embrace approach" held that the US had to embrace the nation openly in order to enable it to moderate the country's military actions behind closed doors.
Underneath this was Biden's decades-long of support for Israel, as well as sharp divisions within his Democratic coalition over the Gaza War. Each move Biden took endangered dividing his own domestic support, while Trump's loyal conservative voters gave him more room to manoeuvre.
Ultimately, domestic politics or personal relationships may have had less importance than the reality that, throughout Biden's presidency, the Israeli government was not ready to make peace.
Several months into his new administration, with Iran chastened, the militant group to its northern border greatly diminished and the coastal strip devastated, every one of its major strategy objectives had been accomplished.
The Israeli missile attack in the Qatari capital, which resulted in the death of a local national but not the intended targets, prompted the president to deliver an ultimatum to Netanyahu. The war had to stop.
The US leader had allowed the Israeli military a relatively free hand in the territory. He provided US armed support to Israeli operations in the neighboring country. But an strike on Qatari territory was a different matter completely, moving him closer to the stance of Arab nations on how best to conclude the conflict.
Several Trump officials have informed the press that this was a turning point which motivated the president to exert maximum pressure to get a peace deal done.
This US president's strong connections with the Gulf states are widely known. He has commercial interests with Qatar and the United Arab Emirates. He began each of his administrations with state visits to the kingdom. This year, he also visited in Doha and Abu Dhabi.
The president's Abraham Accords, which normalised relations between the Jewish state and several Muslim states, including the UAE, was the most significant diplomatic achievement of his first term.
His visits devoted in the capitals of the Gulf region earlier this year contributed to shift his perspective, according to an expert of the Council on Foreign Relations. The US president did not travel to the country on this regional tour but went to the UAE, the kingdom and the state where he received consistent appeals to put a stop to the war.
Within weeks after that attack on the city, the president sat close as the prime minister himself called the Qatari leadership to express regret. Subsequently, the Israeli leader signed off on Trump's comprehensive proposal for Gaza - one that also had the support of key Muslim nations in the region.
If Trump's alliance with Netanyahu gave him the room to influence Israel to strike a deal, his history with Muslim leaders may have secured their support, and helped them convince Hamas to agree to the arrangement.
"A key factor that evidently occurred was that the US leader gained influence with the Israelis, and indirectly with the militants," notes Jon Alterman of the a research center.
"That made a difference. His ability to achieve this on his timing, and not succumb to the desires of the combatants has been a challenge that many earlier administrations have struggled with, and Trump seems to do with some success."
The reality that Trump is much more popular in Israel than Netanyahu himself was an advantage that Trump used to his benefit, he adds.
Now Israel has committed to releasing over a thousand Palestinians imprisoned in its jails and has agreed to a limited pullback from Gaza.
Hamas will free all the remaining hostages, living and dead, captured in the initial October 7 Hamas attack, which caused the loss of over 1,200 Israeli citizens.
An end to the conflict, which has resulted in the devastation of the territory and the deaths of over 67,000 {Palestinians|Pal
A passionate historian and travel writer with expertise in Mediterranean archaeology and Sicilian culture.