Iran's new Supreme Leader, Mojtaba Khamenei, secretly instructed his negotiators for the first time since the war began to move toward a deal on Monday.
He communicated primarily through runners passing handwritten notes to avoid Israeli assassination threats, a breakthrough that, combined with a chaotic day of Pakistani-mediated drafts and a last-minute call between Trump and Netanyahu, produced the two-week ceasefire announced Tuesday night, according to 11 sources with knowledge of the talks cited by Axios.
The diplomatic endgame began badly.
On Monday morning, as Trump worked the crowd at a White House Easter celebration, Special Envoy Steve Witkoff was described as "very angry" and working the phones, according to a source with direct knowledge.
Witkoff told mediators the 10-point counter-proposal just received from Iran was "a disaster, a catastrophe."
That triggered what sources described as a "chaotic" day of amendments, with Pakistani mediators passing new drafts between Witkoff and Iranian Foreign Minister Abbas Araghchi, while Egyptian and Turkish foreign ministers worked to help bridge gaps.
Former Trump adviser Jared Kushner was also involved in the negotiations, Axios reported.
By Monday night, mediators had U.S. approval for an updated proposal for a two-week ceasefire. The decision then rested with Khamenei.
Khamenei, facing an active threat of assassination by Israel, has been communicating primarily via runners passing notes.
Two sources described his blessing for his negotiators to cut a deal as a "breakthrough."
"Without his green light, there wouldn't have been a deal," a regional source told Axios.
Iranian Foreign Minister Araghchi also played a central role, both in handling the negotiations and in pushing Revolutionary Guard commanders to accept a deal, the regional source said.
China was also advising Iran to seek an off-ramp.
By Tuesday morning, it was clear progress was being made, but Trump continued issuing his most harrowing public threats.
Some U.S. media outlets reported Iran was breaking off talks in response.
Sources involved in the negotiations told Axios that was not the case and that there was actually momentum building.
Vice President JD Vance was working the phones from Budapest, dealing primarily with Pakistani counterparts.
Netanyahu was in frequent contact with Trump and his team throughout the day, though the Israelis were growing increasingly concerned they had lost control of the process.
By around noon ET Tuesday, there was a general understanding that the parties were converging on a two-week ceasefire.
Three hours later, Pakistani Prime Minister Shehbaz Sharif published the terms on X and called on both sides to accept.
Trump immediately began receiving calls and text messages from hawkish allies and confidants urging him to reject the ceasefire offer.
The confusion around Trump's thinking was so acute that multiple people who had spoken with him only an hour or two earlier still believed he would spurn the deal, right up until he accepted it.
Shortly before posting his response, Trump spoke to Netanyahu to secure his commitment to adhere to the ceasefire. He then spoke to Pakistani Field Marshal Asim Munir to close the deal.
U.S. forces received the stand-down order 15 minutes after Trump's post.
Araghchi subsequently stated that Iran would adhere to the ceasefire and open the Strait of Hormuz to vessels operating "in coordination with Iran's armed forces."
A senior Israeli official told Axios that Netanyahu had received assurances the U.S. would insist in peace talks that Iran give up its nuclear material, cease enrichment, and abandon its ballistic missile threat.
Vance is expected to lead the U.S. delegation at talks planned for Friday in Islamabad, described by Axios as "easily the most consequential assignment of his political career."
White House Press Secretary Karoline Leavitt told Axios: "There are contacts regarding the talks, but nothing is finalized unless announced by Trump or the White House."
Defense Secretary Pete Hegseth and Leavitt are both expected to hold press conferences on Wednesday, arguing that Trump's threats made the deal possible.
Major gaps remain between U.S. and Iranian visions for a final agreement, Axios reported, leaving open the real possibility that the war could resume.
It remains to be seen to what degree Iran will allow shipping to resume through the Strait of Hormuz or how steadfast Netanyahu will be in adhering to the ceasefire.