Initially, Israel's aerial attack on the Hamas militant delegation in Qatar seemed like another intensification that pushed the hope of peace further away.
The attack on 9 September violated the sovereignty of an American ally and threatened widening the hostilities into a region-wide war.
Negotiations seemed to be collapsing.
However, it proved to be a key moment that has led in a deal, announced by President Donald Trump, to release all remaining hostages.
This is a goal that Trump, and Joe Biden before him, had sought for almost 24 months.
It is just the first step towards a more durable peace, and the details of Hamas disarmament, administering Gaza and full Israeli withdrawal are still to be negotiated.
Yet if this agreement stands, it could be Donald Trump's defining accomplishment of his second term - one that escaped Biden and his diplomatic team.
The president's distinct approach and crucial relationships with the Israeli government and the Arab world appear to have played a role in this success.
However, as with many diplomatic achievements, there were also elements at play beyond the influence of both leaders.
In public, Donald Trump and Benjamin Netanyahu are all smiles.
Trump likes to say that the nation has no greater ally, and the Israeli leader has described him as Israel's "greatest ever ally in the White House". Moreover these positive statements have been backed up by deeds.
During his first presidential term, the president moved the US embassy in the country from its former location to Jerusalem and discarded a long-held US position that Israeli settlements in the occupied territories are illegal, the position under international law.
After Israel began its air strikes against Iran in June, Trump ordered American aircraft to target the nation's nuclear enrichment facilities with its most powerful conventional bombs.
These visible shows of backing may have given the president the leeway to exert more influence on Israel in private. According to reports, the president's negotiator, Steve Witkoff, pressured the prime minister in late 2024 into agreeing to a temporary ceasefire in exchange for the freeing of a number of captives.
After Israeli forces launched strikes against Syria's military in the summer, even hitting a Christian church, the US president urged Netanyahu to alter tactics.
Trump exhibited a level of determination and insistence on an Israel's leader that is rarely seen, says Aaron David Miller of the a think tank. "There is no example of an American president directly instructing an Israeli leader that they must agree or else."
Biden's relationship with Netanyahu's government was consistently more strained.
His administration's "bear hug strategy" argued that the US had to embrace the nation openly in order to enable it to moderate the country's military actions behind closed doors.
Beneath this was Biden's nearly half-century of backing for the state, as well as sharp divisions within his political base over the conflict in Gaza. Every step the leader took endangered fracturing his own domestic support, while Trump's loyal conservative voters gave him more flexibility to act.
In the end, domestic politics or individual ties may have had less importance than the reality that, during his term, the Israeli government was not ready to make peace.
Several months into his new administration, with Iran weakened, the militant group to its northern border greatly diminished and Gaza devastated, all its major strategy objectives had been accomplished.
An Israeli strike in the Qatari capital, which killed a local national but not the intended targets, led Trump to issue an ultimatum to Netanyahu. Hostilities had to end.
Trump had given the Israeli military a significant latitude in the territory. The president provided American military might to Israeli operations in the neighboring country. But an attack on Qatari territory was a separate issue entirely, moving him closer to the stance of Arab nations on how best to conclude the conflict.
Several Trump officials have informed media outlets that this was a decisive moment which galvanised the leader to apply maximum pressure to finalize an agreement.
This US president's strong connections with the Gulf states are widely known. Trump has business dealings with Qatar and the UAE. The president began each of his administrations with official trips to Saudi Arabia. This year, Trump also stopped in Qatar and the UAE capital.
The president's normalization agreements, which established ties between the Jewish state and a number of Arab nations, such as the Emirates, was the biggest diplomatic achievement of his first term.
His visits devoted in the cities of the Arabian Peninsula in recent months helped shift his perspective, says Ed Husain of the Council on Foreign Relations. The US president did not visit the country on this Middle East trip but went to the United Arab Emirates, the kingdom and Qatar where the leader received repeated calls to put a stop to the conflict.
Less than a month after that Israeli strike on the city, Trump sat nearby as Netanyahu himself phoned the Qatari leadership to apologise. Subsequently, the prime minister gave approval on Trump's 20-point peace plan for Gaza - one that also had the backing of key Muslim nations in the region.
Assuming the president's alliance with Netanyahu gave him the ability to pressure Israel to strike a deal, his past with Arab rulers may have ensured their support, and helped them convince Hamas to commit to the arrangement.
"A key factor that clearly happened was that the US leader gained leverage with the Israelis, and through intermediaries with Hamas," says Jon Alterman of the a research center.
"This was crucial. His ability to do this on his own schedule, and avoid yielding to the demands of the warring sides has been a problem that many earlier administrations have struggled with, and he seems to handle relatively successfully."
The fact that Trump is much more popular in Israel than Netanyahu personally was an advantage that Trump employed to his advantage, he adds.
Now Israel has committed to freeing more than 1,000 detainees imprisoned in Israeli prisons and has agreed to a limited pullback from Gaza.
The group will free all the remaining hostages, living and dead, taken during the initial October 7 Hamas attack, which resulted in the death of more than 1,200 Israeli citizens.
An end to the conflict, which has resulted in the devastation of the territory and the fatalities of over 67,000 {Palestinians|Pal