"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," Pakistani Prime Minister Shehbaz Sharif wrote on X on Monday.
The official signing ceremony will take place in Switzerland on Friday, he said.
The precise terms were not immediately known. Sharif said in a post on X that the pact called for "the immediate and permanent termination of military operations on all fronts, including in Lebanon".
Shortly afterwards, Trump also confirmed the agreement with Iran.
"I hereby fully authorize the toll free opening of the Strait of Hormuz, and, simultaneously herewith, authorize the immediate removal of the United States Naval blockade," Trump wrote on his Truth Social platform.
"Ships of the World, start your engines. Let the oil flow!" the US president added.
He soon hedged, however, saying the strait wouldn't open until Friday's signing.
Oil prices fell on the news. Brent crude futures fell four per cent in early trading on Monday, while US West Texas Intermediate slid more than 4.6 per cent.
Iranian Deputy Foreign Minister Kazem Gharibabadi also said on X a more expansive agreement would be negotiated during a 60-day ceasefire period, including sanctions relief.
The fate of Iran's nuclear program will also be addressed in those later talks, sources previously told Reuters.
No further details on the content of the agreement were initially announced.
A senior Iranian official earlier told Reuters that, under the terms of the draft deal, the US would agree to release $US25 billion ($A35 billion) of frozen Iranian assets, while Iran would agree not to produce or acquire nuclear weapons.
Iran agreed to maintain the nuclear status quo, including no uranium enrichment or expanding nuclear facilities, until a final deal is reached.
There was no immediate reaction to the announcement from Israel, which has said it was not party to the planned US-Iran deal.
Prime Minister Benjamin Netanyahu has differed with Trump over American demands that Israel curb its military action in Lebanon to allow the United States to reach a deal with Iran.
Israel has said it will retain freedom of operations in Lebanon, while Iran has made a full ceasefire there an important component of its demands.
The deal had once again appeared to be hanging by a thread after renewed exchanges of fire between Israel and the Lebanese Hezbollah militia.
A Hezbollah attack on northern Israel was followed by an Israeli counter-attack on suburbs of the Lebanese capital Beirut on Sunday afternoon. Trump then warned Israel and called on all sides to show restraint.
The strike near Beirut should not have taken place, "particularly on a special day when we are so close to a Peace Deal with Iran," Trump wrote.
He had originally held out the prospect that a framework agreement to end the war between the US and Iran could be signed on Sunday, his 80th birthday.
Following the Israeli strikes near Beirut, Iran had called into question a possible agreement on a framework deal with the United States.
Iran's Islamic Revolutionary Guard Corps (IRGC) threatened Israel with counter-attacks. The Israeli military said in the late afternoon that it was preparing for the possible bombardment of Israeli territory in the coming hours.
A key condition for Iran in any agreement with the US was an end to military operations on all fronts, including in Lebanon. Tehran had repeatedly stressed that it would not be willing to continue the diplomatic process unless that demand was met.
The framework agreement is intended to serve as a starting point for deeper talks between Washington and Tehran.
In addition to reopening the Strait of Hormuz, the agreement would extend the fragile and repeatedly broken ceasefire by 60 days and launch negotiations on Iran's nuclear program.
The US and Israel had repeatedly justified their war against Iran by saying that the arch-enemy of the Jewish state must not be allowed to obtain nuclear weapons.
It remains unclear whether the planned follow-up talks after the framework agreement will lead to an agreement on Iran's disputed nuclear program.
with Reuters and AP