A joint statement on Monday from mediating nations Qatar and Pakistan said the US and Iran agreed to a roadmap toward a final peace deal within 60 days.
Technical talks will continue for the rest of the week in the Qatari-owned Swiss mountain resort of Buergenstock, according to the statement, which was released by the Qatari foreign ministry.
The parties agreed to a mechanism to end the fighting in Lebanon and opened a communications line to help ensure safe passages for commercial ships through the contested strait, the statement said.
US Vice President JD Vance opened talks with Iranian officials on Sunday under the terms of a memorandum of understanding reached last week to extend a tenuous ceasefire from April for at least another 60 days.
The discussions continued until the early hours of Monday.
In a post on social media, Iranian Foreign Minister Abbas Araqchi said his country had secured waivers for oil and petrochemical exports, the release of some frozen assets and the launch of a reconstruction and development plan for Iran.
Just before talks officially began on Sunday, Fox News reported that Trump had told Iranian officials "you won't have a country" if they tried to close the strait again.
Trump also reiterated an earlier threat that the US would take over the waterway and possibly charge a toll of its own.
US and Iranian sources provided separate accounts of the discussions in Switzerland.
Iran's semi-official Tasnim news agency, citing an informed source, said that after Trump's threats became public, the Iranian delegation refused to return to the room where talks were held, though messages were still being traded via Pakistani and Qatari mediators.
Iranians said that the start of negotiations on nuclear matters required the delivery of other parts of the MOU, including the release of frozen assets and US waivers authorising Iranian oil exports.
"The Iranians never left and are still here meeting and negotiating deep into the night," a US diplomat involved in the talks told Reuters.
"We've talked about the strait, Lebanon, nuclear issues, and details of implementing the MOU, among other topics."
A senior US diplomat engaged in the talks said the Iranians remained in the talks contrary to some reports, and much of the discussions had included clarifying what Iran meant by some of its recent statements about the Strait of Hormuz.
The negotiators also discussed various "mechanisms" to ensure the strait remains open and that a ceasefire in southern Lebanon is enforced.
The agreement called for reopening the Strait of Hormuz, a choke point for global energy shipments, and ending all hostilities, including in Lebanon, where Israel has continued to launch deadly strikes as Iranian ally Hezbollah fires at Israeli targets.
Iran, arguing that the US had failed to meet its commitment to halt fighting in Lebanon, said on the weekend that it had again stopped maritime traffic through the strait and that Sunday's talks would not cover substantive issues such as Iran's nuclear program.
At the talks in Switzerland, where US and Iranian officials met in the presence of Qatari mediators, Vance played down the impact of violence in Lebanon, saying progress had been made towards ending hostilities there.
"These things are always a little bit messy," he said.
On social media Trump threatened to resume attacks on Iran if it did not rein in its allies.
"Iran must immediately stop their highly paid PROXIES in Lebanon from causing trouble," Trump wrote on social media, apparently referring to Hezbollah.
"If they don't, we'll hit Iran very hard again, just like we did last week, only harder!!!"
Even as Trump was threatening Iran, Vance told reporters the US president had "asked us to turn over a new leaf to transform our relationship with the people of Iran".
A US diplomat said discussions included "clarifying some of the confusing messaging from Iran on the strait and building deconfliction mechanisms to ensure the Strait will remain fully open".
Despite the announcement of a new ceasefire in Lebanon on Friday, there has been scant sign of an end to fighting there.
Iran said on Saturday that as a result, it had again shut the strait, whose closure for nearly four months caused the biggest disruption of global energy supplies in history.
US officials dispute that the strait was closed, but commercially available shipping data showed an immediate impact.
Five vessels passed the strait on Sunday, a sharp drop from the 26 ships spotted a day earlier, data from analytics firm Kpler showed. The data may exclude vessels that switch off their transponders while travelling in the Gulf.
Iran's Fars news agency cited a military source as saying on Sunday that no new permits were being issued for ships to cross until further notice.
with AP