Bolivia was captured and recaptured many times during the war by the royalists and patriots. Buenos Aires sent three military campaigns, all of which were defeated, and eventually limited itself to protecting the national borders at Salta. Bolivia was finally freed of Royalist dominion by Marshal Antonio José de Sucre, with a military campaign coming from the North in support of the campaign of Simón Bolívar. After 16 years of war the Republic was proclaimed on 6 August 1825.