 During Ratsiraka's first period in office (the Second Republic), Andrianarivo served in the government as Minister of Industry, Energy and Mines.Following Ratsiraka's victory in the 1996 presidential election, Andrianarivo became Deputy Prime Minister for the Economy and Finance in the new government of Prime Minister Pascal Rakotomavo, named on February 27, 1997; he was one of three deputy prime ministers, along with Pierrot Rajaonarivelo and Herizo Razafimahaleo.Following parliamentary elections held in May 1998, he was named Prime Minister by Ratsiraka in July to replace Rakotomavo.