Sharif, whose country has been mediating in the war, said Pakistan was preparing for an electronic signing that would be followed by technical-level talks next week.
"We are closer to a peace deal than ever before. With finalisation likely expected in the next 24 hours, Pakistan is preparing for the electronic signing of the peace deal immediately after, followed by technical level talks next week," Sharif wrote on X.
"We are confident that this historic peace deal will form a strong foundation for lasting peace."
Earlier, a senior US administration official said both sides had agreed on a text.
Iranian Foreign Minister Abbas Araghchi said the tentative agreement showed his country had emerged stronger from the conflict.
"Iran is the winner of the war with the US," he said on state television.
Hours after those remarks, US forces shot down multiple Iranian one-way attack drones heading toward the Strait of Hormuz, a source familiar with the matter told Reuters. The source said the drones had posed a threat to commercial traffic.
US Central Command confirmed the action and said the waterway was open for transit.
Iranian news agencies reported explosions were heard along the strait in Iran's Sirik port and Qeshm island, which residents and local officials attributed to shots fired by Iranian forces to warn vessels attempting to cross the waterway without permission from the Revolutionary Guards' navy.
The proposed memorandum of understanding calls for reopening the strait and lifting the US naval blockade on Iranian ports, sources on all sides of the talks said. Negotiations over Iran's nuclear program - US President Donald Trump's stated rationale for starting the war - would take place afterward.
Accounts of the draft proposal from Western, Pakistani and Iranian sources pointed to terms that could favour Iran, drawing criticism from Trump, who dismissed the reports as inaccurate.
While there were minor differences in the details, the proposals broadly offered Tehran much of what it has sought, with Trump appearing to secure little beyond the reopening of the strait, which Iran closed after the US and Israel strikes in February.
Araqchi said Iran would, along with Oman, retain control of traffic through the strait, which before the war handled one-fifth of the world's oil and gas supply.
"Our sword will always hang over the Strait of Hormuz," he said.
A Western source said the deal could be signed as soon as Sunday by US Vice President JD Vance and Iran's parliament speaker, Mohammad Baqer Qalibaf, with Geneva seen as the likeliest venue.
The US administration official said Europe had been discussed as a venue for signing but no decision had been made.
US President Donald Trump is travelling to France next week to attend a G7 summit.
Araqchi said the deal would be signed remotely before it is announced.
Draft terms of the deal described to Reuters by multiple sources indicate the US would begin releasing billions of dollars in frozen Iranian assets and waive sanctions on its oil exports, in return for Iran opening the strait.
Iran's nuclear program would be addressed during a 60-day period of talks. The US official said the agreement would ultimately lead to the dismantling of Iran's nuclear program. The terms also include an inspection regime to ensure compliance over the long term.
But Araqchi told state television Iran, which sources said has not accepted the dismantling of its nuclear program, wanted to retain the uranium in diluted form.
Israel has not been part of the negotiations and Prime Minister Benjamin Netanyahu said his country would not be party to the agreement.
Netanyahu has clashed with Trump in recent weeks over US demands that Israel curb military action in Lebanon to allow Washington to reach a deal with Tehran.
Araqchi said the agreement would end the war in Lebanon, implying an Israeli withdrawal from occupied areas.
Israel's defence minister said it would not withdraw. A senior Israeli official said Israel expects to retain its freedom to act against threats.