Treaty of Ayacucho

The Treaty of Ayacucho was an agreement between Brazil and Bolivia signed in 1867. It assigned the land of Acre (now a state in Brazil) to Bolivia in exchange for 102,400 square kilometers of territory further north then annexed to Amazonas. It lasted until 1899, when an expedition led by Luiz Gálvez Rodríguez de Aria set up the first republic of Acre.
Background.
Brazil was pressured to sign the agreement due to a threat of Bolivia joining in the war between Paraguay and Brazil. However, despite Bolivian pressure demarcation was not started until the end of the 19th century.
Collapse.
In Acre profits in rubber drew thousands of Brazilians, largely immigrants from the poor northern coast of the country (deep semi desert of center-southern Ceara state). In 1889, the situation escalated when the Brazilians living in Acre decided to defy the authority of Bolivia. They wanted to create an independent territory, and request annexation from Brazil. Bolivia's response was to found the city of Puerto Alonso (today Porto Acre). Using military force, in October 1889 the Brazilians occupied and expelled the Bolivians.
In July 1899, with the help of the governor of the state of Amazonas, the Brazilian population proclaimed the Republic of Acre.
Bolivia then leased the region through the Treaty of Aramayo to The Bolivian Syndicate of New York in 1901. However, by August 1902, an insurrection of around two thousand Brazilian guerrillas began. They would finally defeat Bolivian force in 1903. José Plácido de Castro was proclaimed governor of the Independent Acre.
Supersession.
Finally, it was superseded in 1903 by the Treaty of Petrópolis, which gave Acre to Brazil, in exchange for some concessions in Mato Grosso.