Spain's government of its colonies in the Americas was divided into various system. One of them was the Viceroyalty of New Spain and the other one was named the Viceroyalty of Peru 1542.
Using those systems allowed Spain to hold more grip into its new land but also it helped prevent rebellions or conquests from other countries.