Initially, Israel's aerial attack on the Hamas militant negotiating team in Qatar seemed like yet another escalation that drove the hope of a ceasefire further away.
This strike on September 9 violated the sovereignty of an American ally and risked expanding the conflict into a broader regional conflict.
Negotiations seemed to be collapsing.
Instead, it turned out to be a key moment that culminated in a deal, declared by President Donald Trump, to free all captives still held.
That represents a objective that he, and Joe Biden before him, had pursued for nearly two years.
This marks just the first step towards a more durable peace, and the specifics of disarming Hamas, Gaza governance and full Israeli withdrawal remain to be worked out.
Yet if this deal stands, it could be Trump's defining accomplishment of his return to office - one that escaped Joe Biden and his diplomatic team.
The president's distinct approach and crucial relationships with Israel and the Middle Eastern nations seem to have contributed in this success.
However, as with most foreign policy wins, there were also factors involved beyond the control of both leaders.
In public, Trump and Israeli Prime Minister Benjamin Netanyahu are consistently friendly.
Trump likes to say that the nation has no greater ally, and Netanyahu has called Trump as the country's "greatest ever ally in the US presidency". And these positive statements have been backed up by deeds.
During his initial time in office, Trump relocated the US embassy in Israel from Tel Aviv to the contested capital and discarded a traditional American stance that Jewish communities in the Palestinian West Bank are illegal, the position under global norms.
When Israel began its bombing campaign against the Islamic Republic in the summer, the US leader ordered American aircraft to target the nation's nuclear enrichment facilities with its largest non-nuclear weapons.
These visible shows of support may have given Trump the leeway to exert more influence on Israel behind the scenes. As per sources, Trump's envoy, his representative, browbeat Netanyahu in the latter part of the year into accepting a halt in fighting in return for the release of some hostages.
After Israel attacked against Syrian forces in July, including hitting a place of worship, Trump pressured his counterpart to change course.
Trump exhibited a level of determination and pressure on an Israel's leader that is virtually unprecedented, says Aaron David Miller of the a think tank. "It's unheard of of an US leader literally telling an Israeli leader that you're going to have to comply or else."
Joe Biden's connection with Netanyahu's government was always more tenuous.
His administration's "bear hug strategy" held that the US had to embrace Israel publicly in order to allow it to moderate the nation's war conduct behind closed doors.
Underneath this was Biden's decades-long of backing for Israel, as well as deep disagreements within his political base over the Gaza War. Every step the leader took endangered fracturing his own domestic support, whereas Trump's solid Republican base gave him more flexibility to manoeuvre.
Ultimately, domestic politics or individual ties may have had less importance than the simple fact that, throughout his term, the Israeli government was not ready to make peace.
Several months into Trump's second term, with Iran weakened, the militant group to its immediate north greatly diminished and the coastal strip devastated, all its major strategy objectives had been accomplished.
The Israeli missile attack in the Qatari capital, which resulted in the death of a Qatari citizen but not the intended targets, led the president to deliver an ultimatum to the prime minister. Hostilities had to stop.
Trump had allowed the Israeli military a relatively free hand in Gaza. The president provided American military might to Israeli operations in the neighboring country. However an strike on Qatari territory was a separate issue entirely, moving him towards the Arab position on how best to end the war.
Several Trump officials have told media outlets that this was a decisive moment which motivated the leader to exert maximum pressure to get a peace deal done.
This US president's close ties with the Gulf states are well documented. He has business dealings with Qatar and the UAE. The president began each of his administrations with official trips to the kingdom. This year, he also visited in Doha and the UAE capital.
The president's normalization agreements, which normalised relations between the Jewish state and several Muslim states, such as the UAE, was the biggest foreign policy success of his first term.
The time he spent in the capitals of the Gulf region earlier this year contributed to shift his perspective, according to Ed Husain of the Council on Foreign Relations. Trump did not visit Israel on this Middle East trip but visited the UAE, Saudi Arabia and the state where the leader received repeated calls to put a stop to the conflict.
Within weeks after that attack on the city, Trump sat nearby as the prime minister himself called 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 support of influential Arab states in the area.
If Trump's alliance with Netanyahu gave him the room to influence Israel to strike a deal, his history with Muslim leaders may have secured their backing, and helped them persuade Hamas to agree to the arrangement.
"A key factor that clearly happened was that the US leader developed influence with the Israelis, and through intermediaries with Hamas," notes an analyst of the Center for Strategic and International Studies.
"That made a difference. His ability to do this on his own schedule, and not succumb to the demands of the combatants has been a challenge that lot of previous presidents have struggled with, and Trump seems to handle relatively successfully."
The reality that Trump is far better liked in Israel than the prime minister himself was leverage that Trump used to his benefit, he adds.
Now Israel has committed to freeing over a thousand Palestinians held in its jails and has consented to a limited pullback from the strip.
The group will release all the remaining hostages, both alive and deceased, taken in the initial October 7 assault, which caused the death of more than 1,200 Israelis.
A conclusion to the war, which has led to the devastation of the territory and the deaths of over 67,000 {Palestinians|Pal
A seasoned gaming analyst with over a decade of experience in the casino industry, specializing in slot mechanics and player psychology.