The 1828 Peruvian–Bolivian War was an invasion of Bolivia by Peru headed by Agustín Gamarra in the form of a foreign intervention in an internal conflict in the Republic of Bolivia, being the first important war in the new country, just three years after becoming independent, and endangering its autonomy as a result of the occupation. Its objective was to force the departure of the troops of the Republic of Colombia from Bolivia, the resignation of Antonio José de Sucre, and the prevention of the opening of a southern front in the event of a war with Colombia. The intervention escalated tensions further, culminating in the Gran Colombia–Peru War.