The Bolivian Republic was one of the three constituent Republics of the short-lived Peru–Bolivian Confederation of 1836–1839. The Confederation came to an end three years later after being defeated by Chile in the War of the Confederation. In August 1839, Agustín Gamarra declared the Confederation dissolved.