to stop the westward advance of the Portuguese, who had already encroached on much of what was theoretically Spanish territory even though it consisted mostly of virgin jungle. They also sought to transfer to Spain the Portuguese colony of Sacramento, which had functioned as a backdoor for the illegal Anglo-Portuguese trade with the Viceroyalty of Peru and which rendered the Spanish city of Buenos Aires dangerously exposed to foreign invasion. Furthermore, they hoped to undermine the Anglo-Portuguese alliance, and thus eventually to facilitate a Spanish-Portuguese alliance against English aggression and ambition in South America. Cartographic issues 1722 map of French cartographer Guillaume de Lisle 1749 map of Alexandre de Gusmão: Mappa das Cortes, or Mapa de las Cortes International context The Philippines and Moluccas were under Spanish sovereignty. Structure of the Treaty The original was in both Portuguese and Spanish. The treaty consists of a lengthy preamble, and 26 articles. Terms of the Treaty The Treaty of Madrid was based on the principles of Uti possidetis, ita possideatis from Roman law (who owns by fact owns by right) and "natural boundaries", stating respectively in the preamble: "each party must stay with what it now holds" and "the boundaries of the two Domains... are the sources and courses of the most notable rivers and mountains", and thereby authorizing the Portuguese to retain the lands they had occupied at the expense of the Empire of Spain. The treaty also stipulated that Spain would receive the Sacramento Colony and Portugal the Misiones Orientales. These were seven independent Jesuit missions of the upper Uruguay River. The Treaty of Tordesillas was specifically abrogated. The treaty sensibly sought to follow geographic features in fixing the boundary: it moved westward from a point on the Atlantic coast south of Rio Grande do Sul, then northward irregularly following parts of the Uruguay, Iguaçu, Paraná, Paraguay, Guapore, Madeira, and Javari Rivers, and north of the Amazon, ran from the middle Negro to the watershed between the Amazon and Orinoco basins and along the Guiana watershed to the Atlantic. Soon after signing it, two commissions for demarcation were created. The Northern, chaired by the State Governor of Grão-Pará and Maranhão, in the South headed on the Portuguese side by the Governor of Rio de Janeiro. Aftermath The Treaty of Madrid was significant because it substantially defined the modern boundaries of Brazil. However, the resistance of the Jesuits to surrendering their