President Trump arrives in Saudi Arabia tomorrow, mere hours after US bombers attacked pro-Assad militiamen whom the US military say were threatening a base in southern Syria where US and British Special Forces are training rebel fighters.

It would be naïve to imagine that the timing of the US attack, the first intentionally made against Syrian government ground forces in six years of war, was not geared to Trump’s Saudi visit. It has the additional great advantage, from the point of view of the White House, of distracting attention from Trump’s disasters in Washington since he sacked James Comey as head of the FBI and saw a Special Counsel appointed to investigate links between his associates and Russia.

A cynical Pentagon saying holds that “defence policy ends at the water’s edge” or, in other words, military decisions are determined by US domestic politics and not developments abroad. Trump is aware that the only time he received plaudits from the US media and his establishment enemies was when he ordered the firing of missiles at a Syrian airbase on 7 April.

“I am getting very good marks on foreign policy,” he said, in tones of surprise, in a Time magazine interview earlier in the month. “I am getting As and A+s on foreign policy.”

As his troubles deepen, military action against foreign foes is one of the few aces he still holds in his hand.

Trump denies that he urged Comey to close Flynn investigation

Even if Trump was not grappling with a crisis in the US that could destroy him, there was always a probability that he would shift to a more interventionist policy abroad than he had advocated during his presidential campaign. His stated aims were contradictory: making America great and respected once again in the world, but at the same opposing foreign wars in Iraq and Libya.

The generals he appointed to top security positions, such as James Mattis as defence secretary and HR McMaster as national security adviser, are certainly not isolationists. Furthermore, a change in America’s international status over the last decade is fuelling enhanced interventionism: the US is no longer politically and economically the superpower it was between the collapse of the Soviet Union in 1991 and the financial crisis of 2007-08, but it retains its military primacy and there is a greater temptation to use it.

Trump badly needs a success. His three-day visit to Saudi Arabia, before going on to Israel, gives him just such an opportunity.

He will probably be able to announce a $110bn weapons sale to the Saudis and emphasise that this means more jobs back in the US. He will be given a welcome of imperial splendour in Riyadh, where there is to be an “Arab Islamic American Summit” and two other summits attended by dozens of Muslim leaders. The message is that the US and Saudi Arabia are at one in confronting the evil Iranians.

Events planned for the multiple summits in Riyadh are pretentious and reek of hypocrisy. One of the most distasteful, called “Tweeps 2017” and to be held in the Ritz Carlton Hotel in Riyadh, is designed to appeal to Trump’s addiction to Twitter. Twitter CEO Jack Dorsey and King Abdullah of Jordan will be there, and there is to be a series of panels on the social media.

This is happening in a country notorious for jailing anybody tweeting the mildest criticism of the government. Amnesty International reports that “the Specialised Criminal Court (SCC) in the capital, Riyadh, sentenced journalist Alaa Brinji to five years in prison and a fine, followed by an eight-year travel ban, for comments he posted on Twitter”. In Saudi Arabia and the Gulf monarchies, critical tweets lead to draconian sentences, ensuring that Twitter is no longer the public forum it was in 2011.

Trump will have a series of bilateral meetings with King Salman, though discussions may be insubstantial since the 81-year-old monarch is incapacitated by old age and the Kingdom is run by his son, deputy crown prince Mohammed bin Salman. Like Trump, he will want to present the occasion as a big success, after the failure of his own interventionist foreign policy in Syria and Yemen to win victories and the U-turn on his economic reform programme under which he had reduced the perks and bonuses of the two-thirds of Saudis who work for the government. Many became sceptical about the personal commitment of bin Salman to austerity after reports that he purchased a yacht for half a billion dollars in 2015.

The phoneyness and extravagance of the events in Riyadh are strongly reminiscent of the infamous celebration of 2,500 years of the Iranian monarchy held by the Shah in Persepolis in 1971. The aim was to put on display the achievements and power of Iran under the Shah, whose officials assembled even more royals, presidents and prime ministers in Persepolis than the 55 leaders and representatives gathered in Riyadh this weekend. It did not do him a lot of good when seven years later, after his overthrow, almost all his ungrateful guests rejected his pleas for a place of refuge.

The cost of this extravagance is not known precisely, though an initial bill for $68m has been leaked, making it possible that the real expenses will be higher and comparable to the estimated $200m spent by the Shah on the Persepolis junket. Then, trees and bushes were planted in the Iranian desert and 50,000 songbirds imported from Europe. Catering was provided by Maxim’s de Paris and the menu included 50 peacocks stuffed with foie gras with their tail feathers reinserted, along with quails eggs stuffed with caviar (though the Shah was allergic to caviar so he had to eat artichokes).

Ivanka Trump leads meeting at White House in father's absence

There are other common features between Iran under the Shah and Saudi Arabia under bin Salman than the holding of such self-aggrandising jamborees. In both countries, rulers let their oil wealth go to their heads and convinced themselves that they could easily turn it into political influence. In both cases, the US and other western powers credulously failed to take on board the limitations of their oil state allies.

Saudi Arabia may purchase $110bn in sophisticated US armaments, but in two years its air force has failed to subdue irregular Houthi forces in Yemen, though its merciless bombardment has brought 17 million Yemenis to the brink of famine and an incipient cholera epidemic.

President Obama came to suspect that the US alliance with Saudi Arabia and other Sunni states might be more trouble than it was worth. Trump believes the opposite. He should keep in mind, however, that in supporting Saudi Arabia and its allies against Iran he is plugging into a ferocious religious war between Sunni and Shia.