The African Union and the Southern Africa Development Community (SADC) have condemned any direct seizure of power by Mr Rajoelina.
"We don't think anybody has the right to unseat an elected government by force," Botswanan Foreign Minister Phando Skelemani told the BBC, speaking on behalf of SADC.
UN Secretary General Ban Ki-moon expressed grave concern at the unrest in Madagascar, appealing to all parties to ensure a "smooth transition".
In a radio address announcing his resignation Mr Ravalomanana said he had decided to give up power after "deep reflection".
"This decision was very difficult and very hard, but it had to be made. We need calm and peace to develop our country," he said.
Mr Ravalomanana's resignation marks a dramatic victory for Mr Rajoelina, who was sacked as mayor of the capital in February.
The former disc jockey took up office at the presidential residence in central Antananarivo on Tuesday before emerging triumphantly to parade among thousands of supporters.
He has announced there will be a new constitution and elections within 24 months.
The current constitution sets a minimum age of 40 for presidential candidates. Mr Rajoelina is 34.
Earlier, a number of government ministers quit, as power ebbed away from the president.
Our correspondent says the mood on the streets was one of relief following fears of a bloody last stand if Mr Ravalomanana had continued to cling to power.
Mr Ravalomanana had said he was ready to fight to the death at the Iavoloha palace, about 15km (nine miles) from the city centre.
On Monday, Mr Rajoelina, who has declared himself president, rejected Mr Ravalomanana's offer of a referendum to solve the crisis and called for his arrest.
Later that day, troops stormed the presidential residence in the centre of the capital and also seized the central bank.
Mr Ravalomanana was re-elected for a second term in office in 2006 and under him, Madagascar's economy has opened up to foreign investment, particularly in mining.
But 70% of the 20 million population still lives on less than $1 (£0.7) a day and correspondents say the opposition has tapped into popular frustration at the failure of this new wealth to trickle down.
Mr Rajoelina had said the president has been a tyrant who misspent public money but Mr Ravalomanana's supporters said his rival is a young troublemaker who has not offered any policy alternatives.
Are you in Madagascar? What are your experiences? Send us your comments using the form below.
Send your pictures and videos to email@example.com or text them to +44 7725 100 100. If you have a large file you can upload here.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.