president of Bolivia in 1826, but political pressure from Peru and internal turmoil made it impossible for him to organize the new state. The very next year, an armed uprising in Chuquisaca was quickly used by Peru as an excuse to invade Bolivia. General Agustín Gamarra marched with an army of nearly 5,000 Peruvian soldiers. He had two clear orders: force the Colombian army to withdraw and promote the creation of a new constitution for that country. The Peruvian army entered La Paz, Bolivia, on May 28, 1828. Under these circumstances, Sucre was forced to resign in September, leaving the country forever. Marshal Andrés de Santa Cruz was elected president of Bolivia in 1829 to replace him, a position that he would hold for the next ten years. Both Gamarra and Santa Cruz agreed that the separation of Peru and Bolivia was a mistake that should be corrected. Their plan for a federation, or at least a confederation, was accepted by the legislative branches of both countries, but they personally disagreed on other issues. Gamarra was in favor of a Peruvian-led union, while Santa Cruz wanted to give more political power to Bolivia. War with Gran Colombia Bolívar did not agree with either Gamarra or Santa Cruz, since Gran Colombia was already his own project of federation to unite most of the former Spanish colonies. Furious about the news in Bolivia, he resolved to declare war against Peru on June 3, 1828. Marshal Sucre was appointed commander of the Colombian army but was soon afterwards murdered. After Bolívar's death in 1830, the Colombian troops withdrew, and the war came to an end. During the war, and with the Peruvian army holding off the Colombian offensive, Gamarra deposed Peruvian President José de la Mar and proclaimed himself the new head of state, titled president. A parliament was assembled, and with a majority of the members in favor of his government, he was able to legalize his position. His rule was difficult, since armed revolts all around the country challenged his authority. Chaos in Peru A new parliament was formed in 1833, but this time it was hostile towards Gamarra. Since his term as president was already over and there was no time to call for elections, it was resolved to turn the presidency over to General Luis Orbegoso. Gamarra did not recognize the new government, and prepared himself to challenge Orbegoso.