The Middle East in 2017 often looked like an alternate reality.

President Trump announced a ban on Muslim visitors in February, and yet was warmly greeted by Muslim leaders in Riyadh in June.

He was hailed as Saudi Arabia’s best friend by Crown Prince Mohammed bin Salman in March, but assailed in December by King Salman for recognising Jerusalem as Israel’s capital.

Russia’s President Putin visited Damascus to demonstrate the regime Riyadh wants gone had won the Syrian civil war because of his support. Less than two weeks earlier, Saudi Arabia and Russia had worked together to renew the Opec-non-Opec oil production deal.

In June, the GCC split over charges that Qatar was destabilising the region.

Iraq’s Kurds voted for independence in September and lost Kirkuk to the central government in October.

In December, Yemen’s former president, Ali Abdullah Saleh, was killed two days after turning against the Houthi rebels he had supported since 2015.

Saudi Arabia legalised cinemas, announced women will soon be allowed to drive and arrested more than 300 of the kingdom’s richest men for misappropriating government money. They could have to repay up to $100bn in total.

Practically all of this was a surprise.

What did not happen was America’s withdrawal from the Iran nuclear agreement that Trump had promised to kill. He denounced Tehran, but did not terminate the pact. It is now in the hands of Congress, where nothing happens fast.

Perversely, a man who promised in 2016 to make America great made it weaker in the Middle East in 2017. Russia is back. Iran, buoyed by the victories of regimes it backs in Iraq and Syria, is stronger than it has been since the 1979 revolution.

We are looking through the looking glass. But it may not be all bad.

America’s dominance after the collapse of the Soviet Union led to hubris and failed wars in Afghanistan and Iraq. A stronger Russia gives the Middle East an alternative. Egypt and others are taking it.

Trump’s Jerusalem announcement has galvanised interest in the moribund Israel-Palestine peace process.

The Islamic State in Iraq & Syria has been smashed in Iraq.

And we have seen Middle East nations that clash on some issues collaborate on others. This should prevent the emergence of two hostile blocs, one headed by Saudi Arabia and the other by Iran.

You do not fight a country that is helping lift oil above $60 a barrel.

The unexpected became normal in the year that just passed, but there is probably still only one Middle East certainty. The price of oil matters most.