Initially, Israel's air strike on the Hamas delegation in Qatar appeared like yet another intensification that pushed the prospect of peace out of reach.
This strike on 9 September violated the sovereignty of an US partner and threatened expanding the conflict into a broader regional conflict.
Diplomacy seemed to be in ruins.
However, it turned out to be a pivotal event that has led in a agreement, announced by Donald Trump, to free all captives still held.
This is a objective that he, and President Joe Biden previously, had pursued for almost 24 months.
This marks just the initial phase towards a lasting resolution, and the details of Hamas disarmament, administering Gaza and full Israeli withdrawal are still to be worked out.
Yet if this deal stands, it could be Donald Trump's defining accomplishment of his return to office - one that eluded Biden and his administration.
Trump's distinct approach and key alliances with the Israeli government and the Middle Eastern nations seem to have played a role in this breakthrough.
However, as with most diplomatic achievements, there were also factors involved beyond the control of both leaders.
In public, Trump and Israeli Prime Minister Benjamin Netanyahu are all smiles.
Trump often states that the nation has no greater ally, and the Israeli leader has called him as Israel's "most supportive friend in the White House". And these positive statements have been backed up by actions.
Throughout his initial time in office, Trump moved the American diplomatic mission in Israel from Tel Aviv to the contested capital and discarded a traditional American stance that Jewish communities in the Palestinian West Bank are against international law, the position under international law.
After the Israeli military began its bombing campaign against the Islamic Republic in June, Trump directed US bombers to strike the Iran's atomic sites with its largest non-nuclear weapons.
These visible shows of backing may have given the president the leeway to apply more influence on Israel in private. As per sources, Trump's negotiator, Steve Witkoff, pressured Netanyahu in late 2024 into agreeing to a temporary ceasefire in exchange for the release of a number of captives.
When Israeli forces launched strikes against Syria's military in the summer, even hitting a place of worship, Trump pressured Netanyahu to alter tactics.
Trump displayed 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 US leader directly instructing an Israeli prime minister that they must agree or else."
Biden's relationship with the Israeli administration was consistently more tenuous.
The Biden team'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.
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. Each move Biden took risked dividing his own political backing, whereas Trump's loyal conservative voters gave him more flexibility to manoeuvre.
In the end, internal considerations or personal relationships may have had little impact than the reality that, throughout Biden's presidency, the Israeli government was unwilling to reach an agreement.
Several months into his new administration, with the Islamic Republic chastened, the militant group to its immediate north greatly diminished and Gaza devastated, all its major strategy objectives had been achieved.
An Israeli strike in Doha, which killed a local national but no Hamas officials, led Trump to deliver an ultimatum to Netanyahu. The war had to end.
Trump had allowed Israel a significant latitude in the territory. The president provided US armed support to Israel's campaign in the neighboring country. But an attack on Qatar soil was a different matter entirely, moving him closer to the stance of Arab nations on how best to conclude the conflict.
A number of Trump officials have informed media outlets that this was a turning point which motivated the leader to exert full force to finalize an agreement.
This US president's strong connections with the Arab monarchies are well documented. Trump has business dealings with the emirate and the UAE. He began both his presidential terms with state visits to Saudi Arabia. Recently, Trump also visited in Qatar and Abu Dhabi.
His normalization agreements, which established ties between Israel and several Muslim states, including the UAE, was the biggest foreign policy success of his first term.
The time he spent in the cities of the Gulf region in recent months contributed to shift his perspective, says an expert of the Council on Foreign Relations. Trump did not travel to the country on this Middle East trip but visited the United Arab Emirates, the kingdom and Qatar where the leader received consistent appeals to bring an end to the war.
Within weeks after that attack on the city, Trump sat close as Netanyahu himself called Qatar to apologise. Subsequently, the prime minister gave approval on the president's comprehensive proposal for Gaza - one that also had the backing of influential Arab states in the region.
If the president's alliance with Netanyahu provided him the room to pressure the government to reach an agreement, his history with Arab rulers may have ensured their support, and assisted them persuade Hamas to commit to the arrangement.
"One of the things that clearly happened was that President Trump gained leverage with the Israelis, and indirectly with Hamas," notes Jon Alterman of the a research center.
"That made a difference. His ability to achieve this on his own schedule, and avoid yielding to the demands of the combatants has been a challenge that lot of previous presidents have struggled with, and he appears to do with some success."
The fact that Trump is far better liked in the nation than the prime minister personally was leverage that he employed to his benefit, he adds.
Now the Israeli government has agreed to releasing more than 1,000 detainees held in Israeli prisons and has consented to a limited pullback from Gaza.
The group will release all the remaining hostages, both alive and deceased, taken during the original 7 October Hamas attack, which caused the death of more than 1,200 Israeli citizens.
A conclusion to the conflict, which has resulted in the destruction of Gaza and the deaths of over 67,000 {Palestinians|Pal