For nearly 300 years, differing interpretations of the Treaty of Tordesillas led to border disputes between Spain and Portugal over the Río de la Plata region.
Portuguese encroachments in the Río de la Plata allowed their merchants to evade commercial restrictions imposed by Spain on the importation of goods into Spanish South America, with Buenos Aires becoming a major centre for smuggled goods.

The two countries attempted to finalise their borders by the 1750 Treaty of Madrid but in 1761, it was annulled by the new Spanish monarch Charles III.
In 1762, Spain entered the Seven Years' War on the side of France; while an invasion of Portugal ended in disaster, the Spanish captured Colonia del Sacramento, now in Uruguay and much of the modern day Brazilian state of Rio Grande do Sul.
Colonia del Sacramento was returned to Portugal by the 1763 Treaty of Paris.

Over the next decade, Portugal reoccupied Rio Grande do Sul in an undeclared war before formal hostilities commenced in the 1776-1777 Spanish–Portuguese War.
In February 1777, a Spanish expeditionary force of 116 ships and 19,000 troops captured the island of Santa Catarina in February before moving against Colonia del Sacramento which surrendered in July.
Fighting ended in February 1777 when Joseph I of Portugal died and his daughter, Spanish-born Maria I, sued for peace.

The First Treaty of San Ildefonso signed on 1 October 1777 established a Boundary Commission to demarcate borders between the two Empires in the Río de la Plata region.
These were later confirmed by the Treaty of El Pardo.
For nearly 300 years, differing interpretations of the Treaty of Tordesillas led to border disputes between Spain and Portugal over the Río de la Plata region. Portuguese encroachments in the Río de la Plata allowed their merchants to evade commercial restrictions imposed by Spain on the importation of goods into Spanish South America, with Buenos Aires becoming a major centre for smuggled goods. 
The two countries attempted to finalise their borders by the 1750 Treaty of Madrid but in 1761, it was annulled by the new Spanish monarch Charles III. In 1762, Spain entered the Seven Years' War on the side of France; while an invasion of Portugal ended in disaster, the Spanish captured Colonia del Sacramento, now in Uruguay and much of the modern day Brazilian state of Rio Grande do Sul. Colonia del Sacramento was returned to Portugal by the 1763 Treaty of Paris.
Over the next decade, Portugal reoccupied Rio Grande do Sul in an undeclared war before formal hostilities commenced in the 1776-1777 Spanish–Portuguese War. In February 1777, a Spanish expeditionary force of 116 ships and 19,000 troops captured the island of Santa Catarina in February before moving against Colonia del Sacramento which surrendered in July. Fighting ended in February 1777 when Joseph I of Portugal died and his daughter, Spanish-born Maria I, sued for peace.
The First Treaty of San Ildefonso signed on 1 October 1777 established a Boundary Commission to demarcate borders between the two Empires in the Río de la Plata region. These were later confirmed by the Treaty of El Pardo.
Treaty of El Pardo (1778)