Initially, the Israeli air strike on the Hamas militant delegation in Doha appeared like yet another escalation that pushed the prospect of peace further away.
The attack on September 9 violated the territorial integrity of an American ally and risked widening the hostilities into a broader regional conflict.
Negotiations seemed to be collapsing.
Instead, it proved to be a pivotal event that culminated in a agreement, declared by Donald Trump, to free all remaining hostages.
That represents 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 specifics of disarming Hamas, administering Gaza and full Israeli withdrawal remain to be worked out.
Yet if this deal holds, it could be Trump's signature achievement of his return to office - one that escaped Joe Biden and his diplomatic team.
The president's unique style and crucial relationships with Israel and the Arab world appear to have contributed in this success.
However, as with many foreign policy wins, there were also elements at play beyond the control of both leaders.
In public, Trump and Israeli Prime Minister Benjamin Netanyahu are consistently friendly.
Trump often states that the nation has no greater ally, and the Israeli leader has called Trump as the country's "greatest ever ally in the White House". And these warm words have been matched by actions.
During his first presidential term, Trump relocated the US embassy in Israel from Tel Aviv to the contested capital and discarded a long-held US position that Israeli settlements in the occupied territories are against international law, the position under global norms.
When the Israeli military began its air strikes against the Islamic Republic in the summer, Trump directed American aircraft to strike the nation's atomic sites with its largest non-nuclear weapons.
These public demonstrations of support may have allowed Trump the room to exert more influence on Israel behind the scenes. According to reports, Trump's envoy, Steve Witkoff, browbeat the prime minister in late 2024 into accepting a temporary ceasefire in return for the freeing of a number of captives.
When Israel attacked against Syrian forces in July, including bombing a place of worship, the US president pressured Netanyahu to alter tactics.
Trump exhibited a level of determination and insistence on an Israel's leader that is virtually unprecedented, according to an analyst of the Carnegie Endowment for International Peace. "There is no example of an US leader literally telling an Israeli prime minister that they must agree or else."
Biden's connection with Netanyahu's government was consistently more strained.
His administration's "bear hug approach" argued that the US had to embrace the nation publicly in order to allow it to influence the country's war conduct behind closed doors.
Beneath this was the president's decades-long of support for Israel, as well as sharp divisions within his political base over the conflict in Gaza. Every step the leader took risked fracturing his own political backing, while his successor's loyal conservative voters provided him more room to act.
In the end, internal considerations or personal relationships may have had little impact than the reality that, during his term, the Israeli government was unwilling to make peace.
Several months into Trump's second term, with the Islamic Republic weakened, Hezbollah to its northern border significantly reduced and the coastal strip devastated, every one of its key military goals had been accomplished.
An Israeli strike in Doha, which resulted in the death of a local national but not the intended targets, prompted Trump to deliver an final demand to the prime minister. Hostilities had to stop.
The US leader had allowed the Israeli military a significant latitude in the territory. He lent American military might to Israeli operations in the neighboring country. But an attack on Qatar soil was a separate issue completely, moving him towards the Arab position on how best to end the war.
A number of Trump officials have informed the press that this was a decisive moment which galvanised the president to exert maximum pressure to get a peace deal done.
This US president's strong connections with the Gulf states are well documented. He has commercial interests with the emirate and the UAE. The president began both his presidential terms with state visits to Saudi Arabia. Recently, he also visited in Doha and Abu Dhabi.
His normalization agreements, which normalised relations between the Jewish state and a number of Arab nations, such as the Emirates, was the most significant foreign policy success of his first term.
His visits he spent in the cities of the Gulf region earlier this year contributed to shift his perspective, according to Ed Husain of the a policy institute. The US president did not travel to Israel on this regional tour but went to the UAE, the kingdom and Qatar where he received repeated calls to put a stop to the war.
Less than a month after that attack on Doha, Trump sat nearby as Netanyahu personally phoned Qatar to apologise. Subsequently, the prime minister gave approval on the president's comprehensive proposal for the territory - one that also had the backing of key Muslim nations in the region.
If Trump's alliance with Netanyahu provided him the ability to pressure Israel to reach an agreement, his past with Arab rulers may have secured their backing, and helped them persuade the group to commit to the arrangement.
"One of the things that clearly happened was that the US leader gained leverage with the Israeli government, and indirectly with the militants," says an analyst 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 combatants has been a problem that many previous presidents have faced, and he appears to do relatively successfully."
The fact that the president is much more popular in the nation than the prime minister himself was leverage that he employed to his benefit, he adds.
Currently the Israeli government has agreed to releasing over a thousand detainees imprisoned in Israeli prisons and has agreed to a limited pullback from Gaza.
The group will free all the captives still held, both alive and deceased, captured during the initial October 7 assault, which resulted in the death of more than 1,200 Israeli citizens.
An end to the conflict, which has led to the destruction of the territory and the deaths of more than 67,000 {Palestinians|Pal
A tech enthusiast and business strategist with over a decade of experience in digital transformation and startup consulting.