 He held the post of Governor of Buenos Aires, under the administration of the Viceroyalty of Perú and Viceroyalty of Río de la Plata, having as his main priority to expel the Portuguese from the "Banda Oriental", present-day Uruguay, without success.Nevertheless, his government was highly praised.He assumed the post of Viceroy in 1778, having had a wide set of accomplishments, developing a local economy, colonizing uninhabited lands (or inhabited by local natives), establishing local government ("Intendencias") all over the viceroyalty and prepared the way to the foundation of the Real Audiencia de Buenos Aires.