"The ministries have been retaken ... Civil servants can return to work as normal," Desire Rasolofomanana, a government minister, said.
Rajoelina has been attempting to force Marc Ravalomanana, the president, from power.
He accuses Ravalomanana of being a dictator who is starving his people.
About 100 people have died in the political unrest since late January.
The government was criticised internationally after security forces opened fire on protesters on February 7, killing 28 people.
Ravalomanana has vowed to see out his term, which runs until the end of 2011.