US and Israeli officials revealed a significant diplomatic development at the height of tensions between the US and Iran, when Iran's supreme leader, Mojtaba Khamenei, for the first time instructed his negotiators to move towards a deal.
According to sources with direct knowledge, this decision came at a critical moment, as US President Donald Trump was publicly warning of an extreme escalation of the conflict.
In parallel with the harsh rhetoric, intense negotiations were taking place behind the scenes to avoid a wide-ranging military clash.
During the crucial hours, US forces in the Middle East were on standby for a possible bombing campaign against Iranian infrastructure, while allies in the region prepared for a harsh response from Tehran.
Inside Iran, reports indicate that numerous civilians are fleeing endangered areas.
The negotiations were intense and often chaotic, with mediators from Pakistan relaying proposals between the parties, while diplomats from Egypt and Turkey tried to bring the positions closer together.
Initially, an Iranian counter-proposal was deemed unacceptable by the American side, but after several rounds of changes, a draft for a two-week ceasefire was reached.
Mojtaba Khamenei's role proved crucial. Due to threats to his security, he communicated in a limited and secretive manner, but his approval of the deal was considered a "turning point" by sources.
Iranian Foreign Minister Abbas Araghchi also played a key role in the process, managing the negotiations and convincing the military structures to accept the agreement.
Meanwhile, China advised Iran to seek a diplomatic way out of the crisis.
On Tuesday, the sides appeared to be moving closer to a ceasefire agreement, despite strong public statements. Pakistan's prime minister released the terms of the agreement and called on the sides to accept it.
After final consultations with allies, including Israel, Trump approved the ceasefire. Shortly thereafter, US forces were ordered to halt preparations for an attack, while Iran confirmed that it would respect the agreement and allow shipping in the Strait of Hormuz.
However, the situation remains fragile. Disagreements between the parties are still deep, particularly over Iran's nuclear program and its missile capabilities, leaving open the possibility of a resumption of the conflict if negotiations fail.