US President Donald Trump signed an agreement with Iran on Wednesday that calls for Tehran to dilute its stockpile of highly enriched uranium and waives US-backed sanctions on the country, immediately allowing Iran to sell its oil freely in a major concession from Washington, according to details released by both countries.

The initial deal to end the war takes “immediate effect” after leaders from both countries signed it, Pakistani Prime Minister Shehbaz Sharif, who helped mediate the agreement, said in a post on social media.

The agreement calls for a permanent end to hostilities and starts a 60-day negotiating clock to reach a final deal on the future of Iran's nuclear programme, though Trump left the door open to resume attacks. It also appears to offer Iran several benefits up front while extracting little in return.

The deal has been shrouded in secrecy and confusion for days. US officials refused to disclose the terms even after saying Trump and Vice President JD Vance digitally signed it over the weekend.

Trump signed a physical copy on Wednesday while dining with French President Emmanuel Macron at Versailles, the palace where many historic agreements have been signed over the centuries, ending wars or territorial disputes.