The United States and Iran have agreed on a deal to end their nearly four-month war, with both sides declaring an immediate and permanent cessation of military operations on all fronts, including in Lebanon.

Pakistan Prime Minister Shehbaz Sharif announced the agreement on Sunday. Pakistan had served as a mediator between the two countries throughout the conflict.

"Following intensive talks, we are pleased to announce that the Peace Deal between the United States of America and Islamic Republic of Iran has been REACHED," Sharif wrote on X. "The official signing ceremony will be on Friday, 19 June in Switzerland."

U.S. President Donald Trump confirmed the deal shortly after the prime minister's announcement. "The deal with the Islamic Republic of Iran is now complete," Trump posted on Truth Social. He added that he was authorising the "toll free opening of the Strait of Hormuz" and the "immediate removal of the United States Naval blockade." In a later post, Trump confirmed the strait would open on Friday.

"With the opening of the Strait upon the signing of the Deal on Friday, for purposes of mine removal, oil will flow on both ends again for the Region, and the World!" Trump wrote.

Iranian state media offered a notably different framing of the agreement. A television banner broadcast by Iranian state TV read: "US was forced to sign an agreement to end the war." The Iranian Foreign Ministry also held the U.S. and Israel "responsible for the dangerous consequences of the continued insecurity and tension in the region."

Qatar's Ministry of Foreign Affairs welcomed the agreement, describing it as "an important step towards consolidating sustainable peace and promoting economic growth regionally and internationally." Qatar noted the deal includes measures to ensure freedom of navigation in the Strait of Hormuz.

European nations — including the United Kingdom, Germany, France and Italy — said Sunday they were prepared to lift sanctions on Iran in exchange for the country taking steps on its nuclear programme. "Iran must never acquire a nuclear weapon. We stand ready to work with the US, Iran and the IAEA to this end," the nations' leaders said in a joint statement, Reuters reported.

A 14-page draft memorandum outlining the terms of the proposed deal had been drawn up on Friday, Iranian state media reported. The draft included provisions for the U.S. to lift oil sanctions and for Iran to commit to reopening the Strait of Hormuz within 30 days.

The deal nearly collapsed earlier Sunday after the Israel Defense Forces reported that Iran-backed Hezbollah in Lebanon had launched projectiles into Israel. Subsequent Israeli strikes in Beirut drew condemnation from Trump, who warned both Iran and Hezbollah not to retaliate. Trump urged both sides not to "blow it."

The Strait of Hormuz, a critical shipping corridor in the Middle East, has been effectively closed since the conflict began in late February. The blockade has created severe supply constraints for oil, gas and fertilizers, driving up prices and fuelling concerns about a return to stagflation. U.S. annual inflation reached 4.2% in May — its highest level in three years.

U.S. Vice President JD Vance, speaking on Fox News immediately after the deal was announced, called it "a great thing for the American people." Vance said the agreement would help drive down energy costs "not just now but for the long term."

The economic fallout from the war has already reverberated through global financial institutions. On Thursday, the European Central Bank raised interest rates by a quarter point — its first such hike since 2023 — becoming the first major global central bank to respond to the energy shock with a rate increase. Market expectations of rate cuts across major economies have broadly faded, replaced by anticipation of higher-for-longer interest rate environments.