SANAA, Yemen -- After months of street protests calling for his resignation, President Ali Abdullah Saleh signed an agreement Wednesday that Yemeni officials said immediately transferred power to his vice president.
The agreement effectively ends Mr. Saleh's 33 years of authoritarian rule, making him the fourth leader forced from power by the Arab Spring revolts that have roiled the Middle East and North Africa. But it is unlikely to restore calm anytime soon to a country that has become increasingly important to the United States as Islamist militants have gained a stronger hold there.
The unity government that is expected to take over in the coming days or weeks will face not only insurgencies that have grown more entrenched during months of turmoil but also festering tribal divisions and the likelihood of continued protests from young demonstrators unsatisfied with Wednesday's deal.
The deal, signed in Riyadh, Saudi Arabia, allows Mr. Saleh to retain his title and certain privileges until elections are held in three months and grants him immunity from prosecution. It was unclear when, and if, the president intended to return to Yemen.
Mr. Saleh's signing of the deal, after months of stalling, appeared to take many Yemenis and diplomats in Yemen by surprise.
Mr. Saleh had resisted signing similar agreements to step down in the past several months, sometimes appearing close and then backing off.
Although the signing was the first time he actually agreed to give up formal authority, it is unclear how big a political presence Mr. Saleh hopes to maintain or how Yemen might overcome its many divisions. His family members retain powerful posts in the military and intelligence service, and Mr. Saleh, a political survivor, has figured out ways to hang on to control when he has been threatened in the past.
Abdul-Ghani al-Iryani, a Yemeni political analyst and the head of a nonpartisan group that campaigns for democracy, said few people thought the agreement signaled the end of Mr. Saleh's political ambitions.
Mr. Saleh appears to have made his move in large part because world powers -- increasingly frustrated with his intransigence -- were threatening sanctions, probably including some targeting him and his family.
"He was afraid he would lose his fortune," said a high-ranking Yemeni official who spoke on condition of anonymity.
Mr. Saleh and his family are believed to have hundreds of millions of dollars in bank accounts and real estate in both the United States and Europe.
It is also possible that Mr. Saleh might have also feared the imposition of a travel ban.
At the United Nations, Secretary-General Ban Ki-moon told reporters Wednesday that Mr. Saleh had informed him in a telephone conversation that he planned to travel to New York City for medical treatment after leaving Riyadh. The Yemeni leader was seriously wounded June 3 in a bomb attack on his presidential palace and spent months convalescing in Saudi Arabia before he returned home in September.
The Obama administration, which has been pressuring Mr. Saleh to sign the agreement, welcomed his acceptance of the power-transfer deal.
"This agreement marks a significant step forward for the Yemeni people in their quest for a unified, democratic, secure and prosperous country," Mark Toner, a State Department spokesman, said at a news briefing in Washington.
Asked about the reported plan by Mr. Saleh to travel to the United States for medical treatment, Mr. Toner said he could not confirm that.
Mr. Saleh's trip to Riyadh, the Saudi capital, had been rumored for days but was not announced beforehand. It came after several days of intense negotiations.
Yemeni opposition leaders, who are expected to join members of Mr. Saleh's party in the new unity government, flew to Riyadh later Wednesday for the signing of the agreement, which was brokered by several Persian Gulf states.
With the signing, power shifted to Vice President Abed Rabbo Mansour al-Hadi.