Even for a leader whose propensity for dramatic and unexplained policy U-turns is without precedent in modern American politics, President Donald Trump's brazen reassessment of Saudi Arabia this weekend was breathtaking even by his own track record.
During the election campaign, he had scorned his opponent Hillary Clinton for accepting a donation from the Saudi royals, often reminded the American people that Saudi Arabia produced most of the September 11 hijackers, and accused the royals of funding Daesh and Al-Qaeda-linked groups in Syria.
Yet there he was in the Saudi capital, Riyadh, giving a speech that could have been written for Mrs Clinton herself.
Gone was the talk about human rights abuses and the fanatical Wahhabi ideology that the kingdom's religious establishment, at the behest of their princely paymasters, promotes at home and throughout the Muslim world.
Instead, Saudi Arabia was transformed into an indispensable American ally – and, most bizarrely, hailed a progressive leader of the Islamic world that will take the lead along with the US in the global fight against Islamist terrorism.
This volte-face has been explained in the context of the biggest ever arms deal in history between the US and Saudi Arabia, secured by Mr Trump before setting off for Riyadh. Worth a staggering $400 billion over 10 years, it will give the American economy – still struggling with the after-effects of the 2008 financial crisis – a much-needed boost.
More crucial, though, was that Mr Trump had agreed to the deal on the condition that an additional $200 billion of direct Saudi economic investment would be concentrated in key swing states in the rust belt -- home to his most ardent supporters and which he must win to be reelected in 2020.
Having thus shrewdly secured the biggest campaign contribution in US history, Mr Trump was also deftly able to deflect attention from his flip-flopping on Saudi Arabia by hardening his consistently critical stance on Iran, accusing the country in his speech of creating instability in its support for Hezbollah, Hamas, the Syrian regime and Houthi rebels in Yemen.
And that was music to the ears of Israel, whose Prime Minister Benjamin Netanyahu is adopting a characteristically pragmatic position as he surveys the ever-maddening Middle East geopolitical landscape. Having established unprecedented (if unofficial) intelligence ties with the Wahhabi kingdom in the face of their own shared hatred of Iran, last week the Wall Street Journal reported that moves were quietly under way to establish official diplomatic ties between the two countries.
Not, of course, that Mr Netanyahu will be taking anything for granted when it comes to the Saudis.
For a start, no one in the right mind could envisage Saudi Arabia as a competent military ally in any war with Iran in the near future. Last time the House of Saud embarked on a massive spending spree, in the 1980s, much of the aircraft and military hardware delivered by Western powers was left to rust in abandoned bases – the senior Saudis princes were more interested in pocketing commissions than investing in the manpower needed to operate them.
The fact that in two years of war with its southern neighbour Yemen – the most impoverished Arab country where the Saudis are fighting a ramshackle army of mostly poorly armed tribesmen – there is still no sign of victory hardly suggests great improvement in military competence in the interim.
Worse, the last time Washington ushered in such a dramatic military and political reset in the Middle East was in 1974, when the Shah of Iran was elevated as the leader of a Western-aligned Muslim world just as Saudi's King Salman is being hailed now.
Since what comes around goes around with depressing frequency in the Middle East, only a fool would not have at the forefront of his mind what happened in Iran just five years later.
John R Bradley's books include 'Saudi Arabia Exposed: Inside a Kingdom in Crisis'