DUBAI (Reuters) - A day before they killed Yemen’s former president, gunmen from the Iran-aligned Houthi militia group overran one of Ali Abdullah Saleh’s fortified compounds in Sanaa.

FILE PHOTO Supporters of Yemen's former President Ali Abdullah Saleh stand under a huge poster of Saleh as they rally in his support in Sanaa, Yemen November 7, 2014. REUTERS/Khaled Abdullah/File Photo

Ransacking the villa, they snapped photos of liquor flasks and vodka bottles and posted them online.

“This is how the traitor (Saleh) and his family lived during a time of war, siege and cholera,” Hamid Rizq, a senior Houthi official, said on his official Twitter account.

The Houthi gunmen acted fast and mercilessly to punish the 75-year-old Saleh for having appeared to switch sides in Yemen’s three-year civil war - a proxy battle for influence between regional powers Iran and Saudi Arabia.

Allied with the Houthis for three years, Saleh had called on Saturday for a “new page” in relations with Saudi Arabia.

The murder is a setback for Riyadh, which had hoped the backing of Saleh – and his loyalist army units in northern Yemen - would help close a war that has killed 10,000 people and caused one of the world’s most acute humanitarian crises.

Saudi Arabia fears the Houthis will become as powerful a force in the Middle East as Lebanon’s Iran-backed Hezbollah.

The Houthis are holding their ground despite air strikes by Saudi Arabia and its allied forces and a naval blockade that has prevented food, medicine and fuel from arriving in Houthi-controlled northern areas, bringing the region to the brink of famine.

Last month, the Houthis fired a ballistic missile into Riyadh.

Now, the Saudis are turning their hopes to Saleh’s son Ahmed Ali – and his good ties with Saudi ally United Arab Emirates – to do the job his father couldn’t.

Photos of Ahmed Ali, a military leader admired by thousands of soldiers in Houthi-run lands, appeared on the front page of UAE newspapers on Wednesday meeting the UAE’s de-facto leader Mohammed bin Zayed.

Saleh’s death caps a 40-year political career that charts Yemen’s tragic modern history. A country with few natural resources, awash in weapons and fractured along tribal and religious lines, Yemen has long been buffeted by its powerful neighbors, particularly Saudi Arabia.

Saleh was the first leader of a unified Yemen in 1990. But he shifted loyalties various times - fighting the Houthis in the 2000s, for example - as the plates of influence shifted in the Middle East.

Slideshow ( 4 images )

In this latest geopolitical drama, the UAE is emerging as playmaker in the Yemen crisis. The UAE has been financing and training armed groups that have been pushing toward the Red Sea port of Hodeida, a Houthi stronghold and entry point for supplies getting to millions of civilians in northern Yemen.

The Saleh family has long enjoyed good relations with the wealthy Gulf state, which had over the decades funded infrastructure projects in Yemen before becoming a key member of the Saudi-led coalition.

Hamza al-Houthi, a top Houthi leader, said the Houthis had suspected the Saleh family’s allegiance to the Saudi-held coalition for some time and that tensions had been brewing since August. Al-Houthi said his troops had intercepted UAE arms shipments bound for Saleh’s family late last month. As punishment, the Houthis killed his nephew Tareq on Monday.

Joost Hiltermann of the International Crisis Group said the latest events mean the war in Yemen is likely to escalate.

“The Houthis, while an important military force, are not particularly adept at politics or governance. Their reach...in the population is limited, and over time that will play into their opponents’ hands.

“But that won’t happen anytime soon, so it looks like the conflict will worsen.”

RISKY GAMBLE

Saleh’s relationship with Saudi Arabia and its allies has been marked by politics and prayer.

Over the past few decades, Riyadh has tried, in succession, to quash an anti-royalist revolution, Marxism and al Qaeda militancy in Yemen. Riyadh backed Saleh, an Arab nationalist strongman, between 1978 and 2012 to help him quash those ideologies before they could seep next door to Saudi Arabia.

But as Arab Spring protests rocked Yemen swept through the Middle East, Riyadh realized Saleh was no longer strong enough for the job and backed a transition to his deputy Abd-Rabbu Mansour Hadi.

When the Houthis attacked Sanaa in 2014 and swept Hadi into Saudi exile, Riyadh began the bombing campaign that continues today.

At that time, Saleh took one of the riskiest gambles of his turbulent career, allying himself to the Houthis, heirs to a theocratic sect that ruled Yemen for a thousand years.

Saleh’s Yemeni military -- which had jets, tank brigades and long-range missiles -- had fought the Houthis in six wars over ten years at the time Saleh had allied himself with Saudi and Western powers.

With Saleh’s experience administering the country and cultivating a strong military, the Houthis made major military gains around the country and together their forces withstood thousands of Saudi-led air strikes.

CRACKING ENTENTE

But the Houthi-Saleh entente cracked in August when a Houthi leader passed over a trusted Saleh confidante for a key military position, according to people in the General People’s Congress Party, the grouping of technocrats and tribal grandees that did Saleh’s bidding throughout his rule.

Saleh loyalists itched for revenge, they said. Fearing disloyalty, the Houthis restricted Saleh to his fief in Sanaa’s political district. Gerald Feierstein, a former U.S. ambassador to Yemen of the Middle East Institute in Washington, said the Houthis then waged their war largely without him.

“Saleh was largely a spent force by the time he died in a weekend’s fighting,” wrote Feierstein in a policy brief.

On November 29, tensions exploded. Rumors swirled in the city of Sanaa that the Houthis were planning to paint the domes of a giant mosque and palace that Saleh had built and named after himself in their trademark green.

When Houthi militia neared the palace, Saleh’s guards fired. The Houthis, experts in mountain guerrilla warfare, overran the palace with grenades and seized it.

The Houthis wanted Saleh to “hand over his weapons and disarm his fighters,” a senior Saleh party official told Reuters. “He refused.”

Another party official said that, contrary to reports that Saleh was in his car trying to flee when he was killed on Dec. 4, the former president had been executed with a gunshot to the head after making a last stand at his house.

Now, the Saleh associate says he and his colleagues are afraid the Houthis will turn against all of them.

“The Houthis want to kill us all.”

For a graphic on Yemen's stalemated war, click tmsnrt.rs/2zqGyq9