 He founded an anatomy center and a hospital, supported the navigation school and ordered the first census of the population.He reincorporated the region of Puna into the Viceroyalty of Peru.At the end of his term as viceroy in 1796 he returned to Spain.