He was twice Minister of Finance. Martim Francisco Ribeiro de Andrada was born in Santos, São Paulo on 9 April 1775. At the time Santos was just a village. His parents were was Colonel José Bonifácio Ribeiro de Andrade and Maria Bárbara da Silva. His brothers were Antônio Carlos and José Bonifácio de Andrada. He attended the University of Coimbra in Portugal, where he received degrees in philosophy (1797) and mathematics (1798). He earned a PhD in Natural Sciences. At the university he worked with the friar José Mariano de Conceição Vellozo, a naturalist, in translating works on mineralogy and agriculture. After returning to Brazil, Ribeiro de Andrada was appointed inspector general of mines in São Paulo state. He traveled extensively in São Paulo in this role, making and recording many scientific findings. In this he was accompanied by his brother José Bonifácio and Lieutenant General Carlos Antônio Napion. In 1820 he and his brother made a tour of the province of São Paulo to find gold deposits. The same year he was appointed secretary and vice president of the provisional government of the province of São Paulo. After the decree of 29 September 1821 had been issued, aiming at again making Brazil a colony of Portugal, he and his brother José Bonifácio contributed to a patriotic proclamation on 24 December 1821. In January 1822 Martim's brother José was in the Court of Rio de Janeiro, then the principal city of Brazil, involved in the public administration and promoting independence. The Portuguese loyalists still dominated, but ill-judged acts of the court had started to create discontent. In the province of São Paulo General João Carlos managed to stamp out moves towards constitutional freedom. Martim was dismissed from the provisional government of São Paulo and sent as a prisoner to the Court of Rio de Janeiro. Martim was appointed Secretary of State of Business and Finance from 4 July 1822 to 28 October 1822 in the first cabinet of the Empire of Brazil. Martim was dismissed on 28 October 1822 and reinstated as Minister of Finance on 30 October 1822. His brother José Bonifácio was restored as premier with the mandate of centralizing the union and preventing disorders. This first ministry was marked by a power struggle between José Bonifácio Ribeiro de Andrada and the Freemason group led by Joaquim Gonçalves Lêdo.