US President Donald Trump and Iranian President Masoud Pezeshkian on Wednesday signed a memorandum of understanding (MoU) to end a war that has devastated the Middle East since late February.

The White House has confirmed the digital signing, noting that an initial phase of the agreement was signed on Sunday by US Vice President JD Vance and Iran's chief negotiator, Mohammad Bagher Ghalibaf, with President Trump witnessing.

Trump had previously announced that both sides had agreed on the deal on 14 June.

Trump told reporters that he had signed the memorandum at the Palace of Versailles, near Paris, where he was attending the G7 Summit ahead of a dinner hosted by French President Emmanuel Macron.

Macron shared a video on social media showing the moment Trump signed the document, in which Trump said: "This was not easy."