(CNN) -- After months of bloodshed, intrigue and revenge that made Yemen seem like an Arabian version of Hamlet, President Ali Abdullah Saleh has finally transferred his powers to his vice president, and elections are to be held in three months. 

At the ceremony in Riyadh, Saudi Arabia, to seal the transition deal worked out by the Gulf Cooperation Council, Saleh seemed relaxed and even chuckled as he signed several copies of the agreement, the result of intense diplomatic shuttling by U.N. envoy Jamal bin Omar and growing pressure from the international community. 

But Saleh also took a parting shot at his opponents, saying they had destroyed in months everything that had been built over years. 

April Longley Alley, Yemen analyst at the International Crisis Group, says the Riyadh deal offers an "opportunity to move past the current political impasse and to deal with critical issues like deteriorating economic and humanitarian conditions as well as the very difficult task of institutional reform." 

Even so, Longley Alley and other analysts expect the epilogue to be anything but predictable. There are plenty of competing elements left behind: the thousands of mainly young demonstrators who took to the streets of Sanaa and other cities in January to demand democratic change, the tribal alliance that took up arms against Saleh, secessionists in the south and a Shiite rebellion in the north, well-organized Islamist groups and a budding al Qaeda franchise. 

Perhaps the most powerful figure in Yemen now is Brig. Gen. Ali Mohsen al-Ahmar, commander of the 1st Armored Division. He defected in March and took a chunk of the army with him. His units now control northern districts of the capital and are facing off against powerful remnants of the Saleh clan. The president's son, Ahmed Ali Abdullah Saleh, long groomed to be his successor, and his nephew, Yahya Muhammad Saleh, command the most effective units. 
What did he say?
 saying they had destroyed in months everything that had been built over years. 