Yemeni President Ali Abdullah Saleh signed a deal on Wednesday to hand over his powers after 33 years in office, ending months of delay that had seen protests that erupted in January slide into deadly unrest.
King Abdullah of Saudi Arabia, who hosted the signing ceremony at his Al-Yamama palace in Riyadh, hailed a "new page" for the impoverished neighbouring country, while US President Barack Obama called on Yemenis to immediately implement the "historic transition" that had been agreed.
Saleh promised "real partnership" with the opposition in implementing the Gulf- and UN-brokered agreement, but thousands of demonstrators again to took to the streets of the capital Sanaa to protest against the deal's promise of immunity from prosecution for both him and his family.
Spokesman Walid al-Amari told AFP they rejected the agreement and called for further mass demonstrations.
Under the deal, which Saleh had stalled for months in defiance of intense domestic and international pressure, the veteran leader will hand his powers to Vice President Abdrabuh Mansur Hadi but remain honorary president for 90 days.
Saleh has repeatedly backed out of signing the deal brokered by Yemen's wealthy Gulf neighbours since the parliamentary opposition inked it back in April.
During his months of prevarication, deadly clashes between loyalist and dissident troops had riven the capital, while militants, some linked to Al-Qaeda, took advantage of the decline of central government control in the provinces to set up base.
But at Wednesday's signing ceremony, Saleh insisted: "We welcome partnership with the opposition to manage the country's affairs and rebuild what the crisis has destroyed."
UN chief Ban Ki-moon said he had called Saleh on Tuesday and "strongly urged" him to sign the deal, which his Yemen envoy Jamal Benomar played a major role in brokering during repeated visits to Sanaa.
"I told him that the United Nations will spare no efforts... so that... peace and stability and democratic order will be restored in Yemen," Ban said.
"I understand the arrangement and agreement is that he will still remain as president. But he told me that he will come to a deal to take medical treatment immediately after signing this agreement," he said.
The 69-year-old Saleh sustained serious blast wounds in a June bombing of his residence for which he has already received extensive treatment in Saudi Arabia.
Under the roadmap brokered by Benomar, Saleh will hand to Hadi "all powers necessary for proceeding with the Gulf initiative and its implementation mechanism and for organising early elections within a 90-day period which begins immediately after the signing."
Signup to our newsletter and follow us on Facebook and Twitter!
Saleh will remain honorary president for 90 days until Hadi is elected as consensus president for an interim two-year period.
The parliamentary opposition, which co-signed the agreement in Riyadh, will put forward a candidate to head a government of national unity, that will be charged with holding talks with the youth activists who have spearheaded the 10 months of protests, the UN envoy said.
But an opposition spokesman warned that the protesters were unlikely to give up their almost daily demonstrations until Saleh has finally quit office completely.
"People will not go back to their homes until the honorary term ends," Mohammed Qahtan, spokesman for the Common Forum opposition bloc, told AFP.
The US president paid tribute to the protesters for enduring a bloody crackdown by Saleh's regime which has left hundreds dead and thousands wounded since January, but called on them to seize on the opportunity of the Riyadh deal.
"For 10 months, the Yemeni people have courageously and steadfastly voiced their demands for change in cities across Yemen in the face of violence and extreme hardship," Obama said.
"Today's agreement brings them a significant step closer to realising their aspirations for a new beginning in Yemen.
The Germany, France and the European Union welcomed the agreement, with EU foreign chief Catherine Ashton saying it was an important first step that "allows the Yemeni people the much needed hope that their country can turn a page in its history and embrace a new future."
"I call on all political groups to help implement the agreement in good faith," she said in a statement. "It should become the foundation for a reconciliation process which reaches out to all Yemenis and enables a peaceful democratic transition to take place."
Protesters again demonstrated in Sanaa earlier on Wednesday. There were also brief clashes in the capital between forces loyal to Saleh and dissident troops, residents said.
Reunifying Yemen's deeply divided armed forces will be one of the major challenges of the transition deal.
Saleh's son Ahmed commands the Republican Guards, his nephew Yehya heads the central security services, and Tariq, another nephew, controls the presidential guard.
But two major army divisions -- one in Sanaa and one in Yemen's second-largest city Taez -- rallied to the opposition and have fought repeated battles against the loyalists, leaving scores dead.