Andrianarivo was born in Ambositra, Amoron'i Mania, in 1954. During Ratsiraka's first period in office, 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 MinisterPascal 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. During the 2002 election dispute between Ratsiraka and Marc Ravalomanana, which eventually led to Ratsiraka being forced into exile, Andrianarivo announced a state of emergency imposed by Ratsiraka following Ravalomanana's declaration that he was president on February 22. In the following months the two rival governments struggled for control of the island. On 27 May 2002, Ravalomanana's forces raided the prime minister's residence in Antananarivo — the last government building in the capital still under the control of the Ratsiraka government — and detained Andrianarivo; Ravalomanana's prime minister, Jacques Sylla, took over the residence. In response, Ratsiraka said he would not participate in planned talks until Andrianarivo was released. Andrianarivo's trial began on December 22, 2003, and on December 24, he was convicted of embezzlement and usurping powers and was sentenced to 12 years of hard labor. He was also fined 42 billion Malagasy francs, about $7.6 million U.S. dollars: about $7.4 million to repay the allegedly embezzled money, and another $200,000 in damages. The prosecution argued that Andrianarivo was not legitimately the Prime Minister when he withdrew the money, and that he therefore did so illegally. Andrianarivo argued that, despite Ravalomanana's nomination of Sylla as Prime Minister, he remained legally Prime Minister until he was detained on 27 May 2002, due to the absence of a decree abrogating his nomination up to that point; he said that it had been necessary to withdraw the money for the payment of wages and other administrative purposes. According to Amnesty International, the trial was "marred by irregularities". His health was also said to be poor at the time. In Ravalomanana's 2003 end of the year speech, he revealed that Andrianarivo was allowed to seek medical treatment abroad. On May 3, 2007, it was announced that about $2.3 million held by Andrianarivo in Switzerland was unfrozen and was again available to him, following a money laundering investigation that was closed due to lack of evidence. Andrianarivo was, however, required to pay for the cost of the investigation, which began in late 2003. The Malagasy government, which wanted the money, protested the Swiss decision. In France, Andrianarivo met with former President Albert Zafy on June 11, 2007; Zafy had also met with Ratsiraka and former Deputy Prime Minister Pierrot Rajaonarivelo in the previous days. Andrianarivo and Ratsiraka met with Zafy again on June 25.