In the end, cooler heads prevailed – at least for now. At 18:32 Washington time, President Donald Trump posted on his social media website that the US and Iran were very far along with a definitive peace agreement and that he had agreed to a two-week ceasefire to allow negotiations to proceed.

It wasn't exactly the last minute, but with Trump's looming 20:00 EDT (00:00 GMT on Wednesday) deadline to reach a deal or the US would launch massive strikes against Iranian energy and transportation infrastructure, it came pretty close.

All of this is contingent on Iran also suspending hostilities and fully opening the Strait of Hormuz to commercial shipping traffic, which it says it will do. But this is the kind of progress that was far from certain as early as Tuesday morning, when Trump threatened the death of Iranian civilisation. Whether such a jaw-dropping threat from an American president pressured Iran to agree to the kind of ceasefire they had previously rejected is uncertain.

What is clear is that Trump's astounding, inflammatory declaration is unlike anything a modern American president has ever levelled or hinted at. Even if the two-week ceasefire does result in a permanent peace, the Iran war – and Trump's recent words – may have fundamentally altered the way the rest of the world views the US.

Democrats were quick to condemn Trump's words, with some calling for his removal. Congressman Joaquin Castro remarked that it is clear the president has continued to decline and is not fit to lead. Despite criticism from various quarters, including some within his party, Trump remains in a position of authority, having achieved a temporary victory with this ceasefire declaration.

Iran's foreign minister stated that the country would halt its defensive operations and allow safe passage through Hormuz. However, the true test lies in the next two weeks of negotiations and the broader implications of this ceasefire on international relations and US credibility.