Trump said the decision was made after conversations with leaders in the Pakastani government. Pakistan has been acting as the negotiating third party in talks between the U.S. and Iran.
Trump had given Iranian leaders a deadline of 8 ET Tuesday to reopen the Strait or face devastating attacks on power plants, bridges and other infrastructure.
"Based on conversations with Prime Minister Shehbaz Sharif and Field Marshal Asim Munir, of Pakistan, and wherein they requested that I hold off the destructive force being sent tonight to Iran, and subject to the Islamic Republic of Iran agreeing to the COMPLETE, IMMEDIATE, and SAFE OPENING of the Strait of Hormuz, I agree to suspend the bombing and attack of Iran for a period of two weeks," Trump wrote on Truth Social roughly an hour before the attack was set to begin.
Iran has agreed, posting on X a response from Foreign Minister Seyed Abbas Araghchi at approximately 7:12 ET.
"For a period of two weeks, safe passage through the Strait of Hormuz will be possible via coordination with Iran's armed forces and with due considerations of technical limitations," Araghchi wrote.
Araghchi also promised Iran's "powerful armed forces" will stand down.
Whether the government actually controls the military was the subject of great speculation by guests on Tuesday night news talk shows.
"If attacks against Iran are halted, our Powerful Armed Forces will cease their defensive operations," Araghchi wrote.
Three-way talks will begin Friday in Pakistan, Fox News reported.
Iran has been under attack from the U.S. and Israel since Feb. 28.
The agreement is a long way from lasting peace but represents a starting point for negotiations to get there, something Trump has said the Islamic government has failed to deliver at every step of previous negotiations.
Iran presented the U.S. with a 10-point plan that is a "workable basis" from which to continue talks, Trump said.
Trump said the U.S. military has already met or surpassed all objectives.
"Almost all of the various points of past contention have been agreed to between the United States and Iran, but a two-week period will allow the agreement to be finalized and consummated," the president wrote.
Trump said he represents not only the United States but the "countries of the Middle East" in these talks.
"It is an Honor to have this Longterm problem close to resolution. Thank you for your attention to this matter! President DONALD J. TRUMP," he wrote.