In 1717 the Viceroyalty of New Granada was created from the northern territories, the "Audiencias" of Bogotá, Quito and Panamá. This viceroyalty initially lasted only until 1724, but was reestablished permanently in 1740. With the creation of the Viceroyalty of the Río de la Plata from southern areas that are now Argentina, Bolivia, Paraguay and Uruguay in 1776, the Charcas and Buenos Aires "audiencias" were similarly lost. The 256-year-old Treaty of Tordesillas was superseded by the 1750 Treaty of Madrid which granted Portugal control of the lands it had occupied in South America in the intervening centuries. This Portuguese occupation led to the Guaraní War of 1756. Amazonas is named after the Amazon River, and was formerly part of the Spanish Viceroyalty of Peru, a region called Spanish Guyana. It was settled by the Portuguese in the early 18th century and incorporated into the Portuguese empire after the Treaty of Madrid in 1750. It became a state of the Brazilian Republic in 1889.