Ali Abdullah Saleh, the former leader of Yemen, was known as a hardy survivor of Middle Eastern politics who had ruled for more than three decades and re-emerged to play a major role in his country’s devastating civil war.

Mr. Saleh, who was killed on Monday in Yemen under circumstances that remained unclear, was a canny manipulator of Yemen’s complex tribal politics who once likened his presidency to “dancing on the heads of snakes,” but his Machiavellian skills and good luck finally ran out. Aides said he died after an explosion at his home in Sana, the capital. Yemen’s Houthi rebels, his onetime allies in the war, said they had killed him in an ambush in the desert.

On Saturday Mr. Saleh had publicly broken with the Houthis, calling on Yemenis to “defend the nation” against them. That move in a lifetime of juggling alliances proved to be his last.