Initially, Israel's aerial attack on the Hamas delegation in Doha seemed like yet another intensification that pushed the prospect of peace out of reach.
This strike on September 9 violated the sovereignty of an American ally and risked widening the hostilities into a region-wide war.
Negotiations appeared to be in ruins.
However, it turned out to be a key moment that culminated in a agreement, announced by President Donald Trump, to free all captives still held.
This is a goal that Trump, and President Joe Biden before him, had sought for nearly two years.
This marks just the initial phase towards a more durable peace, and the specifics of Hamas disarmament, Gaza governance and complete Israeli pullout remain to be negotiated.
Yet if this deal holds, it could be Donald Trump's signature achievement of his return to office - one that escaped Joe Biden and his diplomatic team.
The president's distinct approach and key alliances with the Israeli government and the Middle Eastern nations appear to have contributed in this breakthrough.
However, as with many foreign policy wins, there were also elements at play beyond the influence of both leaders.
Publicly, Trump and Israeli Prime Minister Benjamin Netanyahu are all smiles.
The president often states that Israel has no better friend, and Netanyahu has called Trump as the country's "most supportive friend in the US presidency". And these positive statements have been matched by actions.
During his first presidential term, Trump relocated 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.
When Israel began its air strikes against the Islamic Republic in June, the US leader directed US bombers to strike the Iran's nuclear enrichment facilities with its most powerful conventional bombs.
Those visible shows of backing may have given Trump the room to apply more influence on Israel in private. As per sources, the president's negotiator, his representative, browbeat the prime minister in the latter part of the year into agreeing to a temporary ceasefire in return for the freeing of some hostages.
After Israel launched strikes against Syrian forces in the summer, even hitting a place of worship, the US president pressured his counterpart to change course.
Trump exhibited a degree of determination and pressure on an Israel's leader that is virtually unprecedented, according to Aaron David Miller of the a think tank. "There is no example of an US leader literally telling an Israeli leader that they must agree or else."
Joe Biden's connection with the Israeli administration was always more tenuous.
His administration's "bear hug strategy" argued that the US had to embrace Israel openly in order to enable it to influence the nation's military actions behind closed doors.
Beneath this was Biden'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 endangered dividing his own domestic support, whereas Trump's solid Republican base provided him more flexibility to manoeuvre.
Ultimately, internal considerations or personal relationships may have had little impact than the reality that, during his term, the Israeli government was not ready to reach an agreement.
Several months into his new administration, with Iran weakened, the militant group to its immediate north greatly diminished and Gaza in ruins, every one of its key military goals had been achieved.
The Israeli missile attack in Doha, which resulted in the death of a local national but not the intended targets, led the president to deliver an final demand to Netanyahu. Hostilities had to end.
Trump had given the Israeli military a relatively free hand in Gaza. The president provided US armed support to Israel's campaign in the neighboring country. But an strike on Qatari territory was a separate issue entirely, pushing him towards the stance of Arab nations on how best to end the war.
Several administration figures have told the press that this was a decisive moment which motivated the president to apply maximum pressure to finalize an agreement.
This US president's close ties with the Gulf states are widely known. Trump has business dealings with Qatar and the United Arab Emirates. The president began both his presidential terms with state visits to the kingdom. Recently, Trump also visited in Doha and Abu Dhabi.
The president's Abraham Accords, which normalised relations between Israel and a number of Arab nations, such as the Emirates, was the most significant foreign policy success of his first term.
The time devoted in the capitals of the Arabian Peninsula in recent months contributed to shift his perspective, says Ed Husain of the a policy institute. The US president did not travel to Israel on this regional tour but visited the United Arab Emirates, the kingdom and the state where the leader received consistent appeals to put a stop to the conflict.
Within weeks after that Israeli strike on the city, Trump sat close as Netanyahu personally called Qatar to express regret. And later that day, the Israeli leader signed off on the president's 20-point peace plan for the territory - one that also had the support of influential Arab states in the region.
Assuming the president's alliance with his counterpart provided him the room to influence the government to strike a deal, his past with Muslim leaders may have ensured their support, and helped them persuade Hamas to commit to the deal.
"One of the things that evidently occurred was that the US leader developed leverage with the Israeli government, and indirectly with the militants," says Jon Alterman of the a research center.
"This was crucial. The capacity to do this on his timing, and not succumb to the desires of the combatants has been a problem that many earlier administrations have struggled with, and he appears to handle relatively successfully."
The reality that the president is much more popular in Israel than Netanyahu himself was an advantage that he used to his advantage, the expert continues.
Currently Israel has agreed to freeing more than 1,000 detainees imprisoned in Israeli prisons and has agreed to a limited pullback from the strip.
The group will free all the remaining hostages, living and dead, captured during the initial October 7 Hamas attack, which resulted in the loss of more than 1,200 Israelis.
A conclusion to the conflict, which has resulted in the destruction of Gaza and the deaths of over 67,000 {Palestinians|Pal
A tech enthusiast and consumer advocate with over a decade of experience testing and reviewing products across various categories.