"I wish you all success, I give you my blessing," Rajoelina said, before handing a large golden key as a symbol of power to president-elect Hery Rajaonarimampianina.
A 55-year-old former finance minister, Rajaonarimampianina will be officially sworn in on Saturday.
Rajoelina, 39, who seized power in a 2009 coup, will likely remain a powerful figure either as prime minister or behind the scenes.
Rajoelina and the man he ousted, Marc Ravalomanana, were blocked from running in the polls to prevent violence, so their proxy candidates ran instead.
But there are cautious hopes that Rajoelina's exit from the presidency will end a political and economic crisis that has cost the island around $8bn in lost growth.
Regional mediator Joaquim Chissano and South Africa's deputy foreign minister Marius Fransman attended Friday's ceremony in the reception hall of the presidential residence, the Iavoloha Palace in the capital, Antananarivo.
The international community lauded the democratic transition so far, but cautioned that normalising relations with Madagascar depends on the formation of a new government.