The United States and Iran appear close to a deal to end the war and open the Strait of Hormuz.

Pakistan’s Prime Minister Shehbaz Sharif said Saturday that a deal aimed at ending the war in the Middle East is closer than “ever before” and expected to be finalized within 24 hours. Pakistan is preparing for the electronic signing of the agreement, followed immediately by technical-level talks next week.

Previous declarations of an imminent breakthrough failed to materialize.

The apparent breakthrough in negotiations comes after Iran exchanged fire with the U.S. and Israel over three days this week, threatening to push the region into a full-scale war. U.S. Central Command late Friday said in a social media post that it intercepted several Iranian attack drones that were targeting commercial ships in the Strait of Hormuz.

The war launched by the U.S. and Israel on Feb. 28 has rattled the Middle East and virtually shut down oil and natural gas shipments from the Persian Gulf. A fragile ceasefire has been in place since April 7.