President Donald Trump announced Tuesday evening that the U.S. had reached a two-week ceasefire agreement with Iran ahead of a looming deadline, averting what the president previously described as an attack that would lead to the death of a “whole civilization.”

“The reason for doing so is that we have already met and exceeded all Military objectives, and are very far along with a definitive Agreement concerning Longterm PEACE with Iran, and PEACE in the Middle East,” Trump wrote on Truth Social. “We received a 10 point proposal from Iran, and believe it is a workable basis on which to negotiate.”

Trump — who said the ceasefire was subject to Iran opening the Strait of Hormuz — added that “almost all of the various points of past contention have been agreed to between the United States and Iran,” but he said the two-week ceasefire period “will allow the Agreement to be finalized and consummated.”

The president threatened in a Tuesday morning social media post that “a whole civilization will die tonight, never to be brought back again” if Iran did not reach a deal with the U.S. He had previously said opening the Strait of Hormuz is a “very big priority” in the negotiations.

The president’s escalation in rhetoric sparked worries that the U.S. or Israel could use nuclear weapons against Iran, but international leaders had signaled hope that the U.S. and Iran would reach an 11th-hour deal ahead of the 8 p.m. ET deadline.

Trump also threatened to strike Iran’s civilian infrastructure — including bridges, power plants and desalination plants — if Iran did not move to reopen the strait, elevating warnings from experts that the U.S. could violate international law in the ongoing war. POLITICO previously reported that the Pentagon was expanding a list of acceptable targets in Iran to include energy sites that serve both civilians and the military, giving the administration a possible way out of war crime accusations.

Iran’s closure of the strait, which facilitates the transit of roughly 20 percent of the world’s oil supply, has sent fuel prices skyrocketing across Europe and the U.S., and Trump has repeatedly chided the U.S.’s NATO allies for not offering their assistance in reopening the passage.

He said last week that the war would not cease until the strait was reopened to traffic, adding that the U.S. would be “blasting Iran into oblivion or, as they say, back to the Stone Ages!!!” until then.

Despite his escalating threats, Trump insisted on Monday that Iranian officials were “negotiating, I think, in good faith” with the U.S., although he did not specify who the U.S. was negotiating with.

The president also said he did not worry that his threats to bomb Iranian civilian infrastructure could amount to war crimes, adding, “I hope I don’t have to do it.”

This is a breaking news story that will be updated.