Initially, Israel's air strike on the Hamas delegation in Doha seemed like yet another intensification that pushed the prospect of peace out of reach.
This strike on 9 September breached the territorial integrity of an American ally and threatened expanding the hostilities into a region-wide war.
Negotiations seemed to be collapsing.
However, it turned out to be a pivotal event that culminated in a agreement, declared by Donald Trump, to release all captives still held.
This is a goal that he, and Joe Biden before him, had sought for nearly two years.
It is just the initial phase towards a more durable peace, and the details of Hamas disarmament, Gaza governance and complete Israeli pullout remain to be worked out.
But if this agreement stands, it could be Trump's defining accomplishment of his second term - one that eluded Joe Biden and his administration.
Trump's distinct approach and key alliances with Israel and the Arab world seem to have contributed in this breakthrough.
But, as with most foreign policy wins, there were also factors at play beyond the influence of both leaders.
In public, Trump and Benjamin Netanyahu are consistently friendly.
The president likes to say that Israel has no greater ally, and Netanyahu has described him as Israel's "most supportive friend in the US presidency". Moreover these warm words have been backed up by actions.
Throughout his initial time in office, Trump moved the US embassy in Israel from its former location to the contested capital and abandoned 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 US bombers to target the Iran's nuclear enrichment facilities with its most powerful conventional bombs.
These visible shows of backing may have allowed the president the room to apply more influence on Israel in private. As per sources, the president's negotiator, Steve Witkoff, browbeat the prime minister in late 2024 into accepting a temporary ceasefire in exchange for the release of some hostages.
When Israeli forces launched strikes against Syria's military in the summer, even hitting a place of worship, Trump pressured Netanyahu to alter tactics.
The leader exhibited a degree of determination and pressure on an Israeli prime minister that is virtually unprecedented, says Aaron David Miller of the a think tank. "There is no example of an US leader directly instructing an Israeli leader that they must agree or else."
Biden's connection with the Israeli administration was always more tenuous.
The Biden team's "bear hug approach" argued that the United States had to embrace Israel publicly in order to allow it to influence the country's military actions in private.
Underneath this was the president's decades-long of backing for the state, as well as sharp divisions within his political base over the conflict in Gaza. Every step Biden took risked fracturing his own political backing, whereas Trump's loyal conservative voters provided him more flexibility to manoeuvre.
Ultimately, domestic politics or personal relationships may have had less importance than the simple fact that, during his term, the Israeli government was unwilling to reach an agreement.
Eight months into Trump's second term, with Iran weakened, the militant group to its northern border significantly reduced and the coastal strip in ruins, every one of its key military goals had been achieved.
An Israeli strike in Doha, which killed a local national but not the intended targets, led Trump to deliver an final demand to Netanyahu. The war had to end.
Trump had allowed Israel a significant latitude in Gaza. The president lent US armed support to Israeli operations in Iran. But an strike on Qatari territory was a separate issue entirely, pushing him closer to the Arab position on how best to end the war.
A number of administration figures have informed media outlets that this was a decisive moment which motivated the leader to exert maximum pressure to finalize an agreement.
The leader's close ties with the Arab monarchies are well documented. Trump has commercial interests with the emirate and the UAE. The president began both his presidential terms with official trips to Saudi Arabia. Recently, Trump also visited in Doha and the UAE capital.
His normalization agreements, which established ties between Israel and a number of Arab nations, including the UAE, was the biggest foreign policy success of his first term.
The time he spent in the capitals of the Gulf region earlier this year helped shift his perspective, says Ed Husain of the a policy institute. The US president did not visit the country on this regional tour but went to the UAE, the kingdom and Qatar where he heard consistent appeals to put a stop to the war.
Within weeks after that Israeli strike on Doha, Trump sat nearby as the prime minister himself phoned Qatar to apologise. Subsequently, the Israeli leader signed off on the president's 20-point peace plan for Gaza - one that additionally had the support of influential Arab states in the area.
Assuming the president's relationship with Netanyahu gave him the ability to pressure the government to reach an agreement, his past with Arab rulers may have ensured their support, and helped them persuade the group to commit to the deal.
"A key factor that clearly happened was that President Trump gained leverage with the Israelis, and indirectly with the militants," says an analyst of the Center for Strategic and International Studies.
"That made a difference. His ability to achieve this on his timing, and avoid yielding to the demands of the warring sides has been a problem that many earlier administrations have struggled with, and Trump appears to do with some success."
The fact that Trump is far better liked in Israel than Netanyahu personally was leverage that he used to his advantage, the expert continues.
Currently the Israeli government has agreed to releasing over a thousand detainees held in Israeli prisons and has agreed to a limited pullback from the strip.
Hamas will free all the remaining hostages, living and dead, captured during the original 7 October assault, which resulted in the loss of over 1,200 Israeli citizens.
An end to the conflict, which has led to the devastation of the territory and the fatalities of more than 67,000 {Palestinians|Pal
Lena is a tech enthusiast and business strategist with a passion for digital innovation and entrepreneurship.