Mangalaza was born in Ambodivoanio, located in northeastern Madagascar. As a professor, he taught at the University of Toliara during the 1980s and was Director of Personnel and Human Resources at the Autonomous Port of Toamasina from 1987 to 1989. In the 1989 parliamentary election, he was elected to the National People's Assembly as an AREMA candidate in Mananara-Nord constituency. He served as a Deputy until the NationalPeople's Assembly was dissolved and transitional institutions were established in 1991. Mangalaza was also Rector of the University of Toamasina from 1989 to 2002 and taught philosophy and anthropology there. During the 2009 political crisis, the four main political factions reached an agreement on 6 October 2009 that provided for Andry Rajoelina to remain in his position as Transitional President while also designating Mangalaza to replace Rajoelina ally Monja Roindefo as Prime Minister. Mangalaza's name was proposed during the negotiations by Didier Ratsiraka's faction and a consensus was reached on the selection of Mangalaza as Prime Minister. At the time, Mangalaza was viewed as a politically obscure figure, and his selection was considered surprising. Rajoelina affirmed on 9 October that he would appoint Mangalaza to replace Roindefo. Nevertheless, Roindefo said on 10 October that he would not resign, insisting that he led a legal government and that it was "still fulfilling its mission". He stressed that the faction leaders had not signed the agreement and said that his government could not be removed by international mediators. Mangalaza arrived in Madagascar from Paris on 10 October, and Rajoelina, ignoring Roindefo's objections, appointed Mangalaza as Prime Minister late on the same day. Roindefo took the matter to the Council of State on 12 October 2009, requesting that it annul the decree appointing Mangalaza; he argued that the procedure was flawed and that the faction leaders needed to sign the agreement in order for it to become valid. The Council of State accordingly suspended the decree on 15 October, but lifted the suspension and refused to annul the appointment in its final ruling on 22 October 2009.