Yemen's President Ali Abdullah Saleh has signed a deal to hand over his powers after 33 years in office.
President Saleh has agreed to hand over power to his deputy in return for immunity from prosecution.
He will keep the title of president until new elections within 90 days.
A government of national unity will be formed until the early presidential elections are held, the BBC reports.
The deal follows nine months of protests in which hundreds on demonstrators have been killed.
United Nations secretary general Ban Ki-moon has spoken to President Saleh by phone and says he will now fly to New York for further medical treatment following an apparent assasination attempt earlier in the year.
President Saleh has agreed to sign a transition plan three times before but did not follow through on the promises.
Many Yemeni citizens are angry that President Saleh will receive immunity from prosecution as part of the latest deal.