Saleh is the fourth Arab leader toppled in the wave of Arab Spring uprisings this year, after longtime dictators fell in Tunisia, Egypt and Libya. The deal gives Saleh immunity from prosecution - contradicting one key demand of Yemen's opposition protesters.
Seated beside Saudi King Abdullah in the Saudi capital Riyadh, Saleh signed the U.S.-backed deal hammered out by his country's powerful Gulf Arab neighbors to transfer his power within 30 days to his vice president, Abed Rabbo Mansour Hadi. That will be followed by early presidential elections within 90 days.
He was dressed smartly in a dark business suit with a matching striped tie and handkerchief and he smiled as he signed the deal, then clapped his hands a few times. He then spoke for a few minutes to members of the Saudi royal families and international diplomats, promising his ruling party "will be cooperative" in working with a new unity government.
"This disagreement for the last 10 months has had a big impact on Yemen in the realms of culture, development, politics, which led to a threat to national unity and destroyed what has been built in past years," he said.
Saleh has clung to power despite the 9-month-old uprising, daily mass protests calling for his ouster and a June assassination attempt that left him badly wounded and forced him to travel to Saudi Arabia for more than three months of hospital treatment.
Since February, tens of thousands of Yemenis have protested in cities and towns across the nation, calling for democracy and the fall of Saleh's regime. The uprising has led to a security collapse, with armed tribesmen battling security forces in different regions and al-Qaida-linked militants stepping up operations in the country's restive south.
For months, the U.S. and other world powers pressured Saleh to agree to the power transfer proposal by the Gulf Cooperation Council, and he agreed then backed down several times before. All the while, the uprising raged, security and the economy deteriorated, Al-Qaida in the Arabian Peninsula grew more bold, even seizing some territory.
Even before the uprising began, Yemen was the poorest country in the Middle East, fractured and unstable with a government that had weak authority at best outside the capital Sanaa.
Security is particularly bad in southern Yemen, where al-Qaida militants - from one of the world's most active branches of the terror network - have taken control of entire towns, using the turmoil to strengthen their position.
The nation of some 25 million people is of strategic value to the United States and its Gulf Arab allies, particularly Saudi Arabia. It sits close to the major Gulf oil fields and overlooks key shipping lanes in the Red and Arabian seas.
Saleh addressed the country's troubles without mentioning the demands of protesters who have filled squares across Yemen calling for his ouster, often facing deadly crackdown from his security forces.
He also struck out at those who strove to topple calling the protests the protests a "coup" and a bombing of his palace mosque that seriously wounded him in June "a scandal."
Saleh said his ruling party will be "among the principle participants" in the proposed national unity government that is to be formed between his party and opposition parties, who also signed the deal.
The plan Saleh agreed to calls for a two-year transition period in which a national unity government will amend the constitution, work to restore security and hold a national dialogue on the country's future.
The unarmed protesters have held their ground with remarkable resilience, flocking to the streets of Sanaa and other Yemeni cities and towns to demand reforms and braving a violent crackdown by government forces that has killed hundreds.
Their uprising has at times been hijacked by Yemen's two traditional powers - the tribes and the military - further deepening the country's turmoil. Breakaway military units and tribal fighters have been battling in Sanaa with troops loyal to Saleh, in fighting that has escalated in recent months.
(Copyright 2011 by The Associated Press. All Rights Reserved.)