Ecuador during its long and turbulent history had lost most of its contested territories to each of its more powerful neighbors, such as Colombia in 1832 and 1916, Brazil in 1904 through a series of peaceful treaties, and Peru after a short war in which the Protocol of Rio de Janeiro was signed in 1942.