Ali Abdullah Saleh seized power in Yemeninfo-icon in 1978, when he was only 36 years old. He lost it in 2012, when the 'Arab spring' was in full spate, and had been trying to get it back ever since. Thirty-four years was not enough. But on Monday, his truly astonishing ability to switch sides got him killed.

Saleh was Saudi Arabiainfo-icon's man in Yemen for a long time, but when Riyadh turned against him in 2012 and put his vice-president, Abdrabbuh Mansour Hadi, in power instead, Saleh went rogue. A lot of the armyinfo-icon was still loyal to him, so he made an alliance with the powerful Houthi tribes in the north (exactly the same people whom he had attacked six times in the past), and started working his way back.

In 2014 the Houthi militia and Saleh's forces seized control of the capital, Sanaa, and Saudi Arabia's new placeman, President Hadi, fled south to Aden, the country's second city. Later Hadi fled to Saudi Arabia, and the Houthi-Saleh alliance took over most of the country.

Yemen matters a lot to the Saudis, because it is the other big country in the Arabian Peninsula, with 27 million people (same as Saudi Arabia), but it is very poor and very unstable. The fact that almost half the Yemenis follow the Shiainfo-icon branch of Islam (in their own Zaidi variant) is of particular concern to the Saudi regime.

Such distinctions didn't stop the Houthis (who are Shia) from getting together with Saleh's people (who are mostly Sunnis), because Yemenis are not much troubled by such things. But the Saudi Arabian regime, all Sunnis, is obsessed by the 'Shia threat'. That mostly means Iraninfo-icon, their rival across the Gulf, but the Saudis sees Iranian plots everywhere, especially if there are Shias involved.

The current Yemeni civil warinfo-icon is about the twentieth such power struggle in the past thousand years, and little different from all the others. Iran no doubt enjoys the Saudi Arabian panic about it, but there is no evidence that it is sending the Houthis anything except good wishes. Whereas Riyadh and its allies are sending bombers.

In March 2015 Saudi Arabia and eight Arab allies launched a bombing campaign against the Houthis and Saleh's forces, with the United Statesinfo-icon and the United Kingdominfo-icon both providing political, logistical and propaganda support to the operation. More than 8,000 Yemenis have been killed by the coalition's airstrikes and around 50,000 wounded, but the lines on the ground have scarcely shifted in the past two years.

The air war has been very costly for Saudi Arabia both in money and in reputation, and it has been getting increasingly embarrassing for the man who started it, Saudi Arabian Crown Prince Mohammed bin Salman. So Ali Abdullah Saleh calculated that this was the right time to change sides: he could get a good price for ratting on the Houthis, and maybe even recover the presidency he had held for so long.

He pretended to be driven by humanitarian motives. In a televised speech on Saturday, he called on "the brothers in neighbouring states and the coalition to stop their aggression, lift the siege, open the airports and allow foodinfo-icon aid and the saving of the wounded, and we will turn a new page by virtue of our neighbourliness."

The bit about "aggression" was meant to placate his Yemeni audience, which does not love the Saudis, but he was actually offering to change sides. The Saudi-led coalition immediately responded, welcoming Saleh's decision to "take the lead and to...free Yemen of...militias loyal to Iran."

The Houthis, however, had seen his treachery coming. They accused Saleh of staging a coup against "an alliance he never believed in," and Sanaa was engulfed by heavy artillery fire as the Houthis went to war against their former ally. Despite Saudi airstrikes to help Saleh's forces, the Houthis had fought their way to within 200 metres of Saleh's house by Monday morning.

Reports differ about what happened next. Some say Saleh died in the wreckage of his house, which was blown up by Houthi fighters. Others say he made a run for it in his car, which was hit by a rocket-propelled grenade. What the internetinfo-icon images show is a fatal wound in his head. The old fox is definitely dead, and the civil war within the civil war is probably over.

Bits of Saleh's army may fight on for a while, but without him to bind them together most of Saleh's soldiers will eventually either go over to the Houthis or go home. The Houthis will be a bit weaker without Saleh's support, but so long as the coalition's members are not willing to put large numbers of their own troops on the ground in Yemen - and they are not - the Houthis will probably keep control of most of the country.

And the war will go on until Mohammed bin Salman gets tired of it, or the Saudis get tired of him.

Gwynne Dyer is an independent journalist whose articles are published in 45 countries.

The article was first published here