At first, Israel's aerial attack on the Hamas delegation in Doha seemed like yet another escalation that pushed the hope of a ceasefire out of reach.
This strike on 9 September violated the territorial integrity of an American ally and threatened widening the hostilities into a region-wide war.
Diplomacy appeared to be in ruins.
Instead, it turned out to be a key moment that culminated in a deal, announced by President Donald Trump, to release all remaining hostages.
This is a goal that he, and Joe Biden before him, had pursued for almost 24 months.
This marks just the first step towards a lasting resolution, and the specifics of Hamas disarmament, administering Gaza and full Israeli withdrawal remain to be negotiated.
But if this deal stands, it could be Donald Trump's signature achievement of his second term - one that eluded Biden and his diplomatic team.
The president's unique style and crucial relationships with Israel and the Middle Eastern nations seem to have contributed in this success.
However, as with most diplomatic achievements, there were also factors involved beyond the control of either man.
In public, Trump and Benjamin Netanyahu are all smiles.
Trump likes to say that Israel has no better friend, and Netanyahu has described him as the country's "greatest ever ally in the White House". And these warm words have been matched by deeds.
Throughout his initial time in office, Trump moved the American diplomatic mission in Israel from Tel Aviv to Jerusalem and discarded a traditional American stance that Jewish communities in the Palestinian West Bank are against international law, the view under global norms.
After the Israeli military began its air strikes against Iran in the summer, the US leader ordered US bombers to strike the Iran's nuclear enrichment facilities with its largest non-nuclear weapons.
Those visible shows of backing may have given the president the room to exert more pressure on Israel behind the scenes. According to reports, the president's envoy, Steve Witkoff, browbeat Netanyahu in the latter part of the year into agreeing to a halt in fighting in exchange for the release of some hostages.
After Israeli forces launched strikes against Syria's military in the summer, even bombing a Christian church, the US president pressured his counterpart to change course.
Trump exhibited a degree of determination and insistence on an Israeli prime minister that is virtually unprecedented, says an analyst of the a think tank. "There is no example of an US leader directly instructing an Israeli prime minister that you're going to have to comply or else."
Biden's connection with the Israeli administration was always more tenuous.
The Biden team's "close embrace strategy" held that the United States had to support the nation openly in order to allow it to moderate the country's military actions behind closed doors.
Underneath this was the president's nearly half-century of support for Israel, as well as sharp divisions within his political base over the conflict in Gaza. Every step Biden took risked fracturing his own political backing, while Trump's solid Republican base provided him more room to act.
Ultimately, domestic politics or individual ties may have had little impact than the simple fact that, throughout his term, Israel was not ready to reach an agreement.
Eight months into Trump's second term, with the Islamic Republic weakened, the militant group to its immediate north significantly reduced and the coastal strip devastated, all its major strategy objectives had been accomplished.
The Israeli missile attack in Doha, which resulted in the death of a Qatari citizen but no Hamas officials, led the president to issue an ultimatum to the prime minister. The war had to end.
The US leader had given Israel a relatively free hand in the territory. The president lent American military might to Israel's campaign in Iran. However an attack on Qatar soil was a different matter entirely, pushing him towards the Arab position on how best to end the war.
A number of administration figures have told the press that this was a turning point which motivated the president to apply maximum pressure to get a peace deal done.
The leader's strong connections with the Gulf states are widely known. Trump has business dealings with Qatar and the UAE. He began both his presidential terms with state visits to Saudi Arabia. This year, Trump also visited in Doha and the UAE capital.
The president's Abraham Accords, which normalised relations between Israel and several Muslim states, including the UAE, was the most significant diplomatic achievement of his first term.
The time he spent in the capitals of the Gulf region in recent months contributed to shift his perspective, according to an expert of the a policy institute. Trump did not visit Israel on this regional tour but went to the UAE, Saudi Arabia and Qatar where the leader received consistent appeals to put a stop to the conflict.
Less than a month after that attack on Doha, Trump was present nearby as the prime minister himself phoned Qatar to express regret. And later that day, the prime minister signed off on the president's comprehensive proposal for Gaza - one that additionally had the backing of key Muslim nations in the area.
Assuming Trump's alliance with Netanyahu gave him the ability to influence the government to reach an agreement, his history with Arab rulers may have secured their backing, and assisted them convince the group to commit to the arrangement.
"A key factor that evidently occurred was that the US leader gained leverage with the Israeli government, and indirectly with the militants," says Jon Alterman of the a research center.
"This was crucial. His ability to achieve this on his timing, and avoid yielding to the desires of the combatants has been a problem that many previous presidents have struggled with, and Trump appears to handle with some success."
The fact that the president is much more popular in Israel than the prime minister personally was leverage that he used to his benefit, he adds.
Currently Israel has committed to freeing more than 1,000 Palestinians held in Israeli prisons and has agreed to a limited pullback from the strip.
The group will release all the captives still held, both alive and deceased, taken in the original 7 October Hamas attack, which caused the loss of over 1,200 Israelis.
An end to the conflict, which has resulted in the devastation of the territory and the deaths of over 67,000 {Palestinians|Pal
Agile coach and software developer with over a decade of experience in transforming teams and delivering innovative solutions.