The US and Iran say they have reached a landmark peace agreement after months of fighting and rising tensions across the Middle East, with both sides committing to stop military operations immediately and permanently.

Pakistan Prime Minister Shehbaz Sharif revealed the breakthrough early Monday, describing it as the result of weeks of talks.

“Both sides have declared the immediate and permanent termination of military operations on all fronts, including in Lebanon,” Mr Sharif said on X.

He also said the official signing ceremony is set to take place in Switzerland on June 19.

President Donald Trump soon declared the agreement final, saying it would immediately restore passage through the Strait of Hormuz and end the US naval blockade.

“A deal with the Islamic Republic of Iran is now complete,” he said.

“Congratulations to all! I hereby fully authorise the toll free opening of the Strait of Hormuz, and, simultaneously herewith, authorise the immediate removal of the United States naval blockade.

“Ships of the world, start your engines. Let the oil flow!”

Australia’s Foreign Minister Penny Wong said Canberra supported the development, noting Australia had consistently urged restraint.

“Australia has long called for de-escalation and an end to the conflict, including in Lebanon,” Ms Wong said on Monday.

“As we have said, the longer this war goes on, the greater the impact will be.”

Vice President JD Vance said he would be present when the agreement is signed in Switzerland. Speaking after the negotiations, he said the outcome meant Iran would “never have a nuclear weapon again” and argued the deal would “transform the Middle East for the next 50 years”.

“This will end the war and make the Middle East more investible,” he said.

“It will mean a lot of prosperity and lower energy prices for the American people.”

Tehran later confirmed the deal, while saying discussions had continued right up until the end. Iranian state television framed the outcome by saying the US and Israel had “forced America to accept the end of the war on all fronts”.

A Reuters report, citing an Iranian official, said the final memorandum of understanding addresses several key issues, including Iran’s nuclear activities and the reopening of the Strait of Hormuz.

Iran’s deputy foreign minister Kazem Gharibabadi said the text would be made public after the formal signing, but cautioned that the agreement did not mean “there is trust in the enemy”.

“We will take our own measures if we witness breaches from the other side,” he said.

The announcement followed a tense episode involving Israel, after Trump criticised a strike on Beirut that risked undermining the talks.

In a Truth Social post after the attack on Lebanon, Trump said the strike “should not have happened”.

“This morning’s attack on Beirut should not have happened, particularly on a special day when we are so close to a peace deal with Iran,” he said.

“Israel has the right to defend itself against threats, but the attack it was responding to was very small and meaningless, nobody was hurt, injured or killed, and should not disrupt this important process.

“We are very close to a deal that will bring peace to the region, including to Lebanon, and all sides should stand down.”

Reuters reported that Israel’s N12 later said Trump had updated Prime Minister Benjamin Netanyahu on progress around the proposed deal. Fox News reporter Trey Yingst had earlier said Trump told him he personally phoned Mr Netanyahu after the Beirut strike.

According to Yingst, Trump said he asked the Israeli leader, “What the f— are you doing?” and pressed him not to approve further attacks on Hezbollah positions while the negotiations were still alive.

Iranian negotiator Mohammad Baqer Qalibaf said the strike on Beirut’s southern suburbs, which Israel said targeted Iranian-backed Hezbollah militants, showed Washington lacked the resolve or capacity to carry out its commitments.

Iran’s foreign ministry also blamed the United States for Israel’s attack in Lebanon and warned of a “strong response”.

The fighting between Israel and Hezbollah in Lebanon had flared again after the US-Israeli war against Iran began in February. Israel has made clear it is not part of the planned agreement between Washington and Tehran.

Mr Netanyahu has reportedly clashed with Trump over US pressure on Israel to scale back military action in Lebanon while negotiations with Iran were under way.

“If you lack the will and ability to fulfil your commitments, speaking of continuing the path is not possible,” Mr Qalibaf wrote on X, criticising the US.

On Saturday, Trump and Pakistani mediators had said they expected the agreement to be signed on Sunday, which was also the US President’s 80th birthday. At that stage, one official involved in the discussions said the deal was “nearly over the line”.

Reuters also reported that Qatari mediators travelled to Tehran on Sunday morning to help complete the final arrangements.

Earlier that day, the Israeli military said Hezbollah had fired three projectiles toward northern Israeli communities. Israel then launched strikes on what it called Hezbollah targets in Beirut’s Dahiyeh district, where Lebanon’s civil defence said three people were killed.

Fox News, citing an unidentified diplomat involved in the negotiations, reported that the Israeli strikes had made it harder to complete the US-Iran agreement and were being viewed as an attempt to derail it.

Israel did not answer that accusation, instead saying it would maintain freedom of action in Lebanon.

In the same Sunday post, Trump said there “should be no more attacks by Israel anywhere in Lebanon, but there should also be no more attacks by any other party, including Hezbollah, against Israel”.

The war has killed thousands of people, most of them in Iran and Lebanon, since US and Israeli forces began attacks on Iran on February 28.

Iran’s attacks on Israel and Gulf nations hosting US military bases had effectively shut the Strait of Hormuz, a critical route for oil shipments, sending energy prices higher. The US responded by blocking Iranian ports.

Before the deal was confirmed, Iran’s Fars news agency reported on Sunday, citing an informed source, that Tehran had not yet made a final decision on the framework and was still examining its political, legal and technical dimensions.

According to draft terms described to Reuters by multiple sources, the US would begin releasing frozen Iranian assets and ease sanctions on Iranian oil exports in exchange for Tehran reopening the Strait of Hormuz.

Iran’s nuclear program would then be negotiated over a 60-day period.