Grisly demise for ex-dictator renowned for 'dancing on the head of snakes'
Ali Abdullah Saleh survived for decades as Yemen's strongman, the master of shifting alliances, playing both sides, or flipping sides freely, in the multiple guerrilla conflicts and civil wars that tore apart his impoverished nation throughout his life.
But his last switch proved his end.
Mr Saleh, who was Yemen's president for 33 years until he stepped down in 2012 amid an Arab Spring uprising, was killed on Monday by the Shiite rebels known as Houthis whom he had once allied with in hopes of a return to power but then turned against in recent months.
A video circulating online showed Mr Saleh's body, his eyes open but glassy, motionless, blood staining his shirt and a gaping wound In his head.
He was being carried in a blanket by rebel fighters chanting "God is great" who then dumped him into a pickup vehicle.
His grisly end recalled that of his contemporary, Libya's Muammar Gaddafi, whose body was shown being abused by the rebels who killed him in that country's 2011 civil war.
During his rule, Mr Saleh was known as the man who "dances on the heads of snakes" for his ability to manipulate friends and enemies alike, using patronage, family bonds and brute force.
That skill enabled him to stay on top in the Arab world's poorest nation and one of its most unstable, where tribal and regional alliances and the sheer geography of mountains and deserts made central rule weak.
But the decades of manipulation, corruption and conflict under Mr Saleh left Yemen underdeveloped and dangerously fragile.
Now the civil war, in large part caused by his manoeuvring, has pushed it to near societal collapse.
With hospitals and food distribution networks in a shambles, hunger is widespread among its population of nearly 28 million and it faces a ferociously fast-spreading cholera outbreak.
In the 2000s, Mr Saleh was a vital ally of the United States in fighting al Qaida's branch in his country, a top priority for Washington after the branch tried to blow up a passenger jet an carry out other attacks on American soil.
Even while taking millions in US aid, Mr Saleh was suspected of striking deals with the militants and enlisting them to fight his battles.
Officials in his ally, Saudi Arabia, fumed privately to American diplomats that he was "corrupt, unreliable and largely ineffective", then rushed to help him fight civil wars and domestic conflicts because they needed him.
During one of those wars, a leaked US diplomatic memo suggested Mr Saleh tried to trick Saudi Arabia into killing his own military commander-slash-ally-slash-rival, Ali Mohsen al-Ahmar, by calling in a "mistaken" Saudi airstrike on his home.
Saudi Arabia realised what the target was and called off the strike.
After a popular uprising against his rule erupted in 2011, Mr Saleh cannily managed to hang onto power for months, even surviving a bomb that detonated in the presidential palace mosque as he prayed there, severely burning him.
Still, he stayed on, only finally resigning in early 2012 under a Saudi-brokered deal.
As president, Mr Saleh fought multiple wars against the Houthi rebels in their heartland in northern Yemen, each time failing to crush them completely.
Then after his fall, he allied with the Houthis against his own former vice president and successor, Abed Rabbo Mansour Hadi, likely in hopes he could ride them back into power.
Mr Saleh's loyalist military units helped the Houthis overrun the capital, Sanaa, and much of the north and centre of the country.
Mr Hadi fled, his government moved to the southern city of Aden and Saudi Arabia and its allies launched a coalition air campaign in early 2015.
Then in recent months, Saleh's alliance with the Houthis fell apart as the rebels moved to weaken him and Mr Saleh flirted with switching to side with the Saudi-led coalition.
Mr Saleh rose to power in an era when Yemen was divided into two nations, north and south.
He was born into a small tribe allied with one of the country's mightiest clans, al-Ahmar.
He did not stay long in school, leaving before he was a teenager and enlisting in the armed forces.
His age was not known for sure.
His website gives his birth date as March 21 1946, but many in Yemen say he was born four years earlier.
On the other hand, he just happened to be 40 when he took power in 1978, when the constitution said the president had to be 40.
And in the 2006 election, official statements alternated between saying he was 64 or 65.
Whatever his age, Mr Saleh was ambitious and soon caught the eye of North Yemen's president, Ahmed bin Hussein al-Ghashmi, who appointed him military chief in the city of Taiz, south of Sanaa.
Mr Saleh's moment came after a bomb in a briefcase killed Mr al-Ghashmi in June 1978.
Within a month, Mr Saleh was North Yemen's president, backed by Saudi Arabia.
Among his first acts was to order the execution of 30 officers, some his former friends, convicted of being conspirators in Mr al-Ghashmi's assassination.
His reputation cemented as a tough leader, he also knew how to play Cold War politics.
Marxist South Yemen was a Soviet client state, so Mr Saleh reached out to Western leaders to leverage aid for North Yemen.
I n 1990, with the Soviet Union unravelling, Mr Saleh negotiated unity with the south, ensuring his place as the president.
On May 22 1990, he raised the flag of the Republic of Yemen at the southern port of Aden.
Four years later, he crushed an attempt by the south to break free.
His powerful nexus of the military and tribes made him virtually untouchable.
He also sought to harness a dangerous new force in the country.
Arab militants who had fought the Soviets in Afghanistan in the 1980s needed a new home, and the deal apparently offered by Mr Saleh was sanctuary in exchange for respecting his authority.
In 2000 that legacy came back to haunt him when the Navy destroyer USS Cole was bombed in Aden harbour, killing 17 American sailors.
Washington demanded Mr Saleh to crack down on suspected Islamic militants.
Mr Saleh's efforts against extremist groups were widely criticised as ineffective.
In 2006, a band of al Qaida militants made a bold escape from a Sanaa prison that US and Yemeni officials believed had help from regime insiders.
The band went on to form al Qaida in the Arabian Peninsula, the terror network's Yemen branch.
The group was linked to the attempt to bomb a Detroit-bound airliner on Christmas Day 2009 and a shipment of explosive-rigged packages intercepted in Britain and Dubai in 2010.
Still, the US saw little choice but to partner with him.
Mr Saleh's tribal and political allies were growing impatient, complaining that he was ignoring widespread poverty and that corruption was undermining development.
Most disturbing to them, he was centralising power in his and his family's hands.
He put his sons and nephews in command of his strongest security units.
He appeared to be grooming his son Ahmed, commander of the elite Republic Guard, to succeed him.
When a popular uprising broke out against him in 2011, he responded with token promises of reform, then bloody attacks on the protesters.
He faced a stream of defections from his party, politicians, Cabinet members, tribal allies and military units.
Still, he managed to cling to power, then negotiate an exit deal that not only protected him from arrest and prosecution and let him stay in the country but kept many of his loyalists in place in the military.
That made Mr Saleh a player in the civil war between the Houthis and Mr Hadi.
But the Houthis succeeded in weakening him in recent months, reducing their alliance.
In the hours after his death, many of the Saleh loyalist units were reportedly pulling back from their positions in Sanaa.