 He began to hold public office at age 25 and in 1826 entered as an official in the Secretariat (Ministry) of Interior and Exterior Relations.He was chargé d'affaires of Mexican embassies in Prussia and Britain, and briefly served as Secretary (Minister) of Foreign Affairs on two occasions during the second government of President Anastasio Bustamante (April–October 1837 and January–November 1838).Appointed plenipotentiary for Bustamante to negotiate with France, he could not end the so-called Pastry War.