At first, Israel's air strike on the Hamas militant negotiating team in Doha appeared like another escalation that drove the prospect of peace further away.
This strike on 9 September breached the territorial integrity of an US partner and threatened widening the hostilities into a region-wide war.
Negotiations seemed to be in ruins.
Instead, it turned out to be a key moment that culminated in a agreement, declared by President Donald Trump, to release all captives still held.
This is a objective that he, and President Joe Biden previously, had pursued for nearly two years.
This marks just the first step towards a more durable peace, and the details of disarming Hamas, administering Gaza and full Israeli withdrawal remain to be worked out.
Yet if this agreement stands, it could be Donald Trump's defining accomplishment of his second term - one that eluded Biden and his diplomatic team.
Trump's unique style and key alliances with the Israeli government and the Middle Eastern nations appear to have contributed in this breakthrough.
However, as with most foreign policy wins, there were also factors at play beyond the influence of both leaders.
In public, Trump and Israeli Prime Minister Benjamin Netanyahu are consistently friendly.
Trump likes to say that Israel has no better friend, and the Israeli leader has described Trump as Israel's "greatest ever ally in the US presidency". Moreover these positive statements have been backed up by actions.
During his initial time in office, Trump relocated the US embassy in Israel from Tel Aviv to Jerusalem and abandoned a long-held US position that Jewish communities in the Palestinian West Bank are against international law, the position under global norms.
When the Israeli military began its air strikes against Iran in June, Trump directed US bombers to target the nation's nuclear enrichment facilities with its most powerful conventional bombs.
These visible shows of support may have given Trump the leeway to exert more influence on the Israeli government in private. According to reports, the president's negotiator, his representative, browbeat the prime minister in the latter part of the year into agreeing to a halt in fighting in return for the release of some hostages.
After Israel launched strikes against Syria's military in July, even bombing a place of worship, Trump pressured Netanyahu to change course.
The leader exhibited a level of determination and insistence on an Israel's leader that is virtually unprecedented, says an analyst of the a think tank. "It's unheard of of an American president directly instructing an Israeli prime minister that they must agree or else."
Biden's connection with the Israeli administration was always more tenuous.
The Biden team's "close embrace strategy" held that the US had to embrace the nation openly in order to enable it to moderate the country's war conduct in private.
Underneath this was Biden's decades-long of backing for Israel, as well as deep disagreements within his Democratic coalition over the conflict in Gaza. Each move the leader took risked dividing his own domestic support, while his successor's loyal conservative voters gave him more flexibility to manoeuvre.
In the end, internal considerations or personal relationships may have had less importance than the reality that, throughout his term, the Israeli government was unwilling to reach an agreement.
Eight months into Trump's second term, with Iran chastened, Hezbollah to its northern border significantly reduced and the coastal strip in ruins, all its major strategy objectives had been accomplished.
An Israeli strike in Doha, which resulted in the death of a local national but no Hamas officials, prompted Trump to issue an ultimatum to the prime minister. The war had to stop.
The US leader had allowed the Israeli military a significant latitude in the territory. The president lent American military might to Israel's campaign in the neighboring country. However an attack on Qatar soil was a different matter entirely, pushing 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 decisive moment which galvanised the president to apply maximum pressure to get a peace deal done.
The leader's close ties with the Gulf states are well documented. He has business dealings with Qatar and the United Arab Emirates. The president began each of his administrations with official trips to the kingdom. This year, Trump also visited in Doha and Abu Dhabi.
His normalization agreements, which established ties between Israel and several Muslim states, such as the Emirates, was the most significant diplomatic achievement of his first term.
The time he spent in the capitals of the Arabian Peninsula earlier this year helped shift his perspective, according to Ed Husain of the Council on Foreign Relations. Trump did not travel to Israel on this Middle East trip but went to the United Arab Emirates, the kingdom and Qatar where the leader heard repeated calls to bring an end to the war.
Less than a month after that attack on the city, the president was present nearby as the prime minister himself called Qatar to express regret. Subsequently, the prime minister gave approval on the president's 20-point peace plan for Gaza - one that also had the support of key Muslim nations in the region.
Assuming the president's alliance with Netanyahu provided him the room to influence the government to strike a deal, his past with Arab rulers may have ensured their backing, and assisted them persuade the group to commit to the arrangement.
"A key factor that evidently occurred was that President Trump gained leverage with the Israeli government, and through intermediaries with Hamas," says Jon Alterman of the a research center.
"That made a difference. The capacity to do this on his timing, and avoid yielding to the demands of the warring sides has been a challenge that many earlier administrations have faced, and he seems to do with some success."
The reality that the president is far better liked in the nation than Netanyahu himself was an advantage that Trump used to his advantage, he adds.
Now Israel has committed to releasing more than 1,000 detainees imprisoned in Israeli prisons and has consented to a limited pullback from Gaza.
The group will free all the captives still held, living and dead, captured in the original 7 October Hamas attack, which caused the death of over 1,200 Israeli citizens.
An end to the war, which has led to the devastation of the territory and the deaths of more than 67,000 {Palestinians|Pal
A passionate eSports journalist and former competitive gamer, dedicated to uncovering the stories behind the screens.