Treaty of Madrid (13 January 1750)

The Treaty of Madrid was an agreement concluded between Spain and Portugal on 13 January 1750. In an effort to end decades of conflict in the region of present-day Uruguay, the treaty established detailed territorial boundaries between Portuguese Brazil and the Spanish colonial territories to the south and west. Portugal also recognized Spain's claim to the Philippines while Spain acceded to the westward expansion of Brazil. 
Most notably, Spain and Portugal expressly abandoned the papal bull "Inter caetera" and the treaties of Tordesillas and Zaragoza as the legal basis for colonial division.
Background.
Earlier treaties such as the Treaty of Tordesillas and the Treaty of Zaragoza authored by both countries, and as mediated by Pope Alexander VI, stipulated that the Portuguese empire in South America could extend no farther west than 370 leagues west of Cape Verde Islands (called the Tordesillas meridian, approx. the 46th meridian). Had these treaties remained unchanged, the Spanish would have held both what is today the city of São Paulo and all land to the west and south. Thus, Brazil would be only a fraction of its present-day size.
Gold was discovered in Mato Grosso in 1695. Starting in the 17th century, Portuguese explorers, traders, and missionaries from the state of Maranhao in the north, and gold-seekers and slave-hunters, the famous "bandeirantes" of São Paulo, in the south, had penetrated far to the west and southwest of the old treaty-line also looking for slaves.
New captaincies (administrative divisions) created by the Portuguese beyond Brazil's previously-established boundaries: Minas Gerais, Goias, Mato Grosso, Santa Catarina.
National motivations.
Portugal.
The Portuguese wanted to strike a balance between the boundary claims of Spain and Portugal by allotting the greater part of the Amazon basin to the latter and that of the Rio de la Plata to the former. They also sought to secure the undisputed sovereignty of the gold and diamond districts of Goias and Mato Grosso for the Portuguese Crown as well as secure Brazil's frontier by the retention of the Rio Grande do Sul and the acquisition of the Spanish Jesuit missions ("Seven Peoples") on the left bank of the river Uruguay. They hoped that the meeting would allow them to secure the western frontier of Brazil and river communication with Maranhao-Para by ensuring that navigation on the rivers Tocantins, Tapajos and Madeira remain in Portuguese hands
Spain.
Spain instead was desirous 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.
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 missions and the refusal of the Guaraní to be forcibly relocated led to the nullification of the treaty by the subsequent Treaty of El Pardo, signed by both countries in 1761. The opposition by the Guaraní led to the Guaraní War of 1756. The terms of the Treaty of Madrid, with a few exceptions, were re-established in the First Treaty of San Ildefonso in 1777, and that treaty was again negated in 1801.