The boundary line crosses a variety of terrains, going from large urban areas by inhospitable deserts and forests. It begins in the Pantanal and ends in the Amazon rainforest. The length of the border is 3,423 km.
The first treaty of limits between Brazil and Bolivia was signed in 1867, without properly knowing the geographical location of rivers in the Amazon Basin; so much so that one of his articles established the boundary line out of the Madeira River, a parallel west to the headwaters of the Javari River - setting even if those sources were north of the parallel (what actually happened), the line should follow "from the same latitude" to that source. In 1898, it was found that according to the 1867 Treaty, the Acre region originally belonged to Bolivia, but that region had a sizeable population of Brazilian origin. This caused many clashes, since the population did not want to submit to the Bolivian government, which tried to lease the land to the Anglo-Americans. Several riots emerged, and the situation of noncompliance lasted until 1903, when Brazil militarily occupied the territory until it finally decided the issues. Then Acre was pacified, and a fine was paid to the Anglo-American tenants, who declared the withdrawal.
In the same year, 1903, the negotiations reopened after Brazil's suggestion of an agreement on the basis of a fair exchange of territory, as was the interest of Brazil to keep under its control a population that was Brazilian, despite the territory was, according to the Treaty of 1867, belonging to Bolivia. Finally the talks began and after series of proposals and counter-proposals, the Treaty of Petropolis was signed, agreed that getting through territorial compensations elsewhere in the border, the construction due to the Brazil of a railway (the Madeira-Mamoré Railway), freedom of transit by rail and by river to the Atlantic Ocean and a two million pounds compensation, Bolivia would give Acre. This time, according to Rio Branco, a real territorial expansion was going on (since according to him the previous elections were only held the "national heritage").