Ravalomanana pledged in December not to run, and regional government leaders were pressing Rajoelina to also not run.
Rajoelina said he preferred personal sacrifice than to sacrifice the people of Madagascar.
There had been fears heavy violence would break out in the May election.
Seychelles President James Michel on Wednesday welcomed Andry Rajoelina’s decision, saying it was “a great act of statesmanship.”
The Southern African Development Community, a regional bloc of 15 countries, had recommended that neither Ravalomanana nor Rajoelina run as a way of resolving Madagascar’s political troubles.
Source: AP