Iran and the US inched closer to a deal to end the Iran war, as Qatari mediators traveled to Tehran on Sunday to finalize the agreement, according to two regional officials. This was reported by Qazaqyia.kz citing Associated Press.

The officials, speaking on condition of anonymity, expressed cautious optimism that the US and Iran were finally approaching an agreement that could halt hostilities that have killed thousands of people and reopen the Strait of Hormuz, whose closure has thrown world markets into disarray.

US President Donald Trump and Pakistani Prime Minister Shehbaz Sharif said Saturday that the deal would be signed on Sunday, while Iran's foreign ministry spokesperson Esmail Baghaei said it could happen in the coming days. Trump said that the Strait of Hormuz would open immediately after the signing.

The deal is expected to be signed electronically, without an in-person ceremony, though it's unclear when the signing will take place.

The deal does not solve the thorniest issues between the US and Iran, including Iran's nuclear program or its frozen assets, but offers a 60-day framework for technical discussions on those issues, according to Pakistani and regional officials.

Under the current deal, the US and Israel appear to have fallen short of their original goals of destroying Iran's missile and nuclear programs and ending its support for proxies.

Trump was expected to discuss demining the Strait of Hormuz during the Group of Seven summit starting Monday. The waterway is crucial to significant shipments of oil, natural gas and related products.

The apparent breakthrough came after Iran exchanged fire with the US and Israel earlier in the week, threatening to rupture the ceasefire. A tenuous ceasefire has been in place since April 7.

Iran's nuclear program and highly enriched uranium have long been at the center of tensions with the US and Israel.

Trump on social media asserted that "when all is calm," the US would go in and "downblend and destroy" the enriched uranium in Iran or in the US.

Iran has 440.9 kilograms (972 pounds) of uranium enriched up to 60% purity, a short step from weapons-grade levels of 90%, according to the International Atomic Energy Agency.

Iran has long maintained its nuclear program is peaceful and has not publicly committed to giving up the enriched uranium.

Fighting has continued in Lebanon between Israel and the Iranian-backed Hezbollah militant group despite a ceasefire.

Iran has wanted a ceasefire deal to include the fighting in Lebanon and the release of billions of dollars in frozen funds.

The deal in its current form is a deep disappointment to Israel's government, which has been sidelined in negotiations. Even critics in Trump's own Republican Party criticized the deal.