I spent most of the last year reporting two sieges, Mosul in Iraq and Raqqa in Syria, which finally ended with the decisive defeat of Isis. This was the most important event in the Middle East in 2017, though people are already beginning to forget how dangerous the Isis caliphate was at the height of its power and even in its decline. Not so long ago, its “emirs” ruled an area in western Iraq and eastern Syria which was the size of Great Britain and Isis-inspired or organised terrorists dominated the news every few months by carrying out atrocities from Manchester to Kabul and Berlin to the Sahara. Isis retains the capacity to slaughter civilians – witness events in Sinai and Afghanistan in the last few weeks – but no longer has its own powerful centrally organised state which was what made it such a threat.

The defeat of Isis is cheering in itself and its fall has other positive implications. It is a sign that the end may be coming to the cycle of wars that have torn apart Iraq since 2003, when the US and Britain overthrew Saddam Hussein, and Syria since 2011, when the uprising started against President Bashar al-Assad. So many conflicts were intertwined on the Iraqi and Syrian battlefields – Sunni against Shia, Arab against Kurd, Iran against Saudi Arabia, people against dictatorship, US against a variety of opponents – that the ending of these multiple crises was always going to be messy. But winners and losers are emerging who will shape the region for decades to come. Over-cautious warnings that Isis and al-Qaeda may rise again or transmute into a new equally lethal form underestimate the depth of the changes that have happened over the last few years. The Jihadis have lost regional support, popular Sunni sympathy, the element of surprise, the momentum of victory while their enemies are far stronger than they used to be. The resurrection of the Isis state would be virtually impossible.

But the defeat of Isis in its heartlands has not produced the rejoicing that might have been expected. This is partly because people are uncertain that the snake is really dead and rightly fearful that Isis can kill a lot of people in its death throws. I was in Baghdad in October and November where there are now less violent incidents than at any time since 2003. Compare this with upwards of 3,000 people blown up, shot or tortured to death in the capital in a single month at the height of the Sunni-Shia sectarian civil war in 2006-7. At that time, Iraqi young men would have their bodies tattooed so they could be identified after death even if they were badly mutilated. Only eighteen months ago, a bomb in a truck in the Karada district of Baghdad, killed at least 323 people so Baghdadis are understandably wary of celebrating peace prematurely.

Yet there is a good chance the period of wars and emergencies that have battered Iraq for the last forty years are coming to an end. There is no home-grown insurgency powered by foreign states in the offing. Beyond its borders, the northern tier of the Middle East between Iran and the Mediterranean, stretching through Iraq, Syria and Lebanon appears to be stabilising.

The new area of instability in the Middle East today is further south in the Arabian Peninsula where turmoil rapidly escalated in 2017. The stalemated war in Yemen is now the bloodiest and cruellest in the region, with eight million Yemenis facing famine because of the Saudi-led blockade; there are over one million suspected cholera cases, the biggest outbreak of the disease in modern history.

Much of the destabilisation of the Arabian Peninsula stems from the proactive foreign and domestic policies of Crown Prince Mohammed bin Salman (MbS) which have made the Saudi Kingdom, once staunchly cautious and conservative, the regional “wild card”. Some of his actions, such as the reported detention and enforced resignation of Lebanese Prime Minister Saad Harari, have a comic opera aspect to them, but others are more serious.

When President Trump visited Saudi Arabia in May, MbS must have felt that the winds of change were blowing in his favour. But few things have worked out as expected: Trump pleased his Saudi hosts by blaming all the troubles of the Middle East on Iran, but so far the anti-Iranian thrust of US policy has remained largely rhetorical. The main Saudi initiative in the Gulf has been the blockade of Qatar which has so far achieved little for the Kingdom and the UAE aside from pushing Qatar towards Turkey and Iran. This confrontation has produced some light relief with furious exchanges between the UAE and Turkey, the Turkish President Recep Tayyip Erdogan tweeting the UAE foreign minister: “When my ancestors were defending Medina, you impudent (man), where were yours?” On the Red Sea side of Saudi Arabia, Sudan is considering withdrawing its troops from Yemen where they have provided many of the ground forces for the Saudi-backed coalition.

The US and the West Europeans treat Saudi Arabia as if it was a regional hegemon in the making. Their motives are self-interested and they obviously want to go on selling arms to the Kingdom and its remaining Gulf allies. But events in the Arabian Peninsula over the last year illustrate a general truth about oil states: their money may buy them power and influence up to a certain point, but their operational capacity is much more limited than they imagine. This is true of Saudi Arabia, Qatar, UAE, Iraq and even little Iraqi Kurdistan which unwisely aspired to be a new oil-rich Emirate.

The recent history of these states illustrates a general rule: possession of great revenues from oil, gas or any natural resources such as minerals breeds arrogance and self-destructive ambition. When King Idris of Libya was told in the 1960s that oil companies had found oil in his country, he is reputed to have replied: “I wish you people had found water. Water makes men work. Oil makes men dream.” The quotation is a little too pat, but everything that has happened in the Middle East and North Africa over the last half century has underlined the truth of his remark. Oil money can achieve only so much: it can buy expensive modern weapons, but it cannot win wars as we are seeing in Yemen. It can buy allies but they do just as little as they can for their pay and their loyalty ends just as soon as the money runs out.

The good news for 2018 is that the barbarous wars in Iraq and Syria may finally be coming to an end. Not only do Iraqis and Syrians and their neighbours benefit from this: what happens in the region soon has repercussions for the rest of the planet, as we saw when the invasion of Iraq in 2003 turned al-Qaeda into a mass movement and finally produced Isis, a militarised cult of demonic savagery. Whatever else happened in the world in 2017, the destruction of the Isis caliphate has made it a good year.