At first, Israel's aerial attack on the Hamas militant negotiating team in Qatar appeared like yet another escalation that drove the hope of peace out of reach.
This strike on September 9 violated the territorial integrity of an American ally and threatened expanding the hostilities into a broader regional conflict.
Diplomacy appeared to be collapsing.
Instead, it proved to be a pivotal event that has led in a deal, announced by Donald Trump, to release all remaining hostages.
That represents a goal that Trump, and Joe Biden previously, had pursued for almost 24 months.
This marks just the first step towards a more durable peace, and the details of Hamas disarmament, Gaza governance and full Israeli withdrawal remain to be negotiated.
But if this deal holds, it could be Trump's signature achievement of his return to office - one that eluded 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 breakthrough.
But, as with most foreign policy wins, there were also factors at play beyond the influence of both leaders.
Publicly, Trump and Benjamin Netanyahu are consistently friendly.
Trump likes to say that the nation has no better friend, and Netanyahu has called Trump as the country's "most supportive friend in the White House". And these warm words have been backed up by deeds.
During his first presidential term, the president moved the US embassy in the country from Tel Aviv to Jerusalem and discarded a traditional American stance that Israeli settlements in the occupied territories are against international law, the position under global norms.
When Israel began its air strikes against the Islamic Republic in the summer, Trump ordered US bombers to strike the nation's atomic sites with its most powerful conventional bombs.
These visible shows of support may have given Trump the room to apply more pressure on the Israeli government behind the scenes. According to reports, Trump's negotiator, Steve Witkoff, pressured Netanyahu in late 2024 into accepting a temporary ceasefire in exchange for the freeing of a number of captives.
When Israel attacked against Syrian forces in July, even bombing a place of worship, the US president pressured his counterpart to alter tactics.
The leader displayed a level of determination and insistence on an Israel's leader that is rarely seen, says Aaron David Miller of the Carnegie Endowment for International Peace. "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 the Israeli administration was always more tenuous.
The Biden team's "bear hug strategy" argued that the United States had to embrace Israel openly in order to enable it to moderate the nation's war conduct behind closed doors.
Underneath this was Biden's decades-long of support for the state, as well as deep disagreements within his political base over the conflict in Gaza. Each move the leader took risked fracturing his own domestic support, whereas Trump's loyal conservative voters gave him more room to manoeuvre.
In the end, internal considerations or individual ties may have had little impact than the simple fact that, throughout his term, the Israeli government was unwilling to reach an agreement.
Several months into Trump's second term, with Iran weakened, the militant group to its immediate north significantly reduced and the coastal strip in ruins, every one of its key military goals had been accomplished.
The Israeli missile attack in the Qatari capital, which killed a Qatari citizen but not the intended targets, led Trump to issue an ultimatum to Netanyahu. Hostilities had to end.
The US leader had allowed Israel a relatively free hand in Gaza. He lent American military might to Israel's campaign in the neighboring country. However an strike on Qatari territory was a different matter entirely, moving him towards the stance of Arab nations on how best to end the war.
Several Trump officials have informed the press that this was a decisive moment which motivated the leader to apply full force to get a peace deal done.
This US president's strong connections with the Gulf states are well documented. Trump has commercial interests with Qatar and the United Arab Emirates. He began both his presidential terms with official trips to the kingdom. Recently, Trump also visited in Qatar and the UAE capital.
His Abraham Accords, which established ties between the Jewish state and a number of Arab nations, such as the UAE, was the most significant diplomatic achievement of his initial presidency.
The time devoted in the cities of the Gulf region in recent months helped shift his perspective, according to Ed Husain of the Council on Foreign Relations. The US president did not visit Israel on this regional tour but visited the United Arab Emirates, Saudi Arabia and Qatar where he received repeated calls to bring an end to the conflict.
Less than a month after that Israeli strike on the city, the president 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 20-point peace plan for the territory - one that additionally had the support of influential Arab states in the area.
Assuming the president's alliance with Netanyahu provided him the room to influence the government to reach an agreement, his history with Arab rulers may have secured their support, and assisted them convince the group to commit to the arrangement.
"A key factor that evidently occurred was that President Trump gained leverage with the Israelis, and indirectly with Hamas," says Jon Alterman of the Center for Strategic and International Studies.
"That made a difference. His ability to do this on his own schedule, and avoid yielding to the demands of the warring sides has been a challenge that many previous presidents have struggled with, and he appears to do relatively successfully."
The reality that the president is far better liked in the nation than Netanyahu personally was leverage that he used to his benefit, he adds.
Currently the Israeli government has agreed to releasing more than 1,000 Palestinians held in Israeli prisons and has agreed to a partial withdrawal from the strip.
The group will release all the captives still held, both alive and deceased, captured during the original 7 October assault, which resulted in the death of over 1,200 Israeli citizens.
An end to the conflict, which has resulted in the destruction of the territory and the deaths of over 67,000 {Palestinians|Pal
A seasoned gaming analyst with over a decade of experience in online casinos, specializing in slot machine strategies and player psychology.