Dissolution of the Peru–Bolivian Confederation
The dissolution of the Peru–Bolivian Confederation was the process of internal disintegration within the Peru–Bolivian Confederation which resulted in the end of the country's and its confederate government's existence as a sovereign state, being succeeded by Bolivia and a unified Peruvian state. The disintegration was related to the conflict of interest between the Confederation and the Republic of Chile, as well as the friction inherited by the Bolivian side with the latter. Unlike Gran Colombia, which was created in 1819 and disappeared in 1831, the dissolution of the Confederation was marked by a certain tranquility and tolerance for a certain period of one year when Agustín Gamarra himself began his military campaign in Bolivian territory, resulting in his death and the signing of the Treaty of Puno, which put an end to all ideas of union, annexation, confederation or federation between the two countries at least during the beginning of the 19th century. Background
After the creation of the Confederation by Andrés de Santa Cruz, protests began by opposition and nationalist sides of both nations, causing massive deportations to Europe or other countries in the Americas, several of them as political refugees. Abroad, Andrés de Santa Cruz also had opponents, especially in Chile, such as Minister Diego Portales and Chilean President Joaquín Prieto. In one of his letters, Portales spoke about the Peru-Bolivian Confederation and its "unacceptable" existence:

Peruvians opposed to the Confederation such as Agustín Gamarra, Ramón Castilla or Antonio Gutiérrez de la Fuente accepted the alliance with Chile to remove Andrés de Santa Cruz and return the respective united nations to their normal state. Dissolution
During its existence, the government of Santa Cruz saw the rise of different parallel governments. Peruvian Republic (1837)

During the first expedition of the United Restoration Army, the restorers disembarked on Islay and immediately entered the city of Arequipa, where a council proclaimed De La Fuente the Supreme Chief on October 17, 1837, a position he held only nominally. Cornered by Santa Cruz's Confederate troops, the restorers were forced to sign the Paucarpata Peace Treaty on November 17, 1837. La Fuente returned to Chile along with the rest of the Chilean-Peruvian expedition. Peruvian Republic (1838–1839)

Santa Cruz appointed Luis José de Orbegoso as president of North Peru from August 21, 1837 to September 1, 1838. However, Orbegoso remained in office when Santa Cruz himself appointed Marshal José de la Riva-Agüero as his replacement on July 11, 1838, a position that he held, precariously, until January 24, 1939. Domingo Nieto remained faithful to the legal authority of Orbegoso, however, he did not compromise with the Confederate regime and put himself at the service of the will of the people. Finally, he decided to rise up against Santa Cruz and proclaimed the freedom of the territory of the North-Peruvian State as the Peruvian Republic, on July 30, 1838. Orbegoso, undecided at first, ended up joining that cause and General Juan Francisco de Vidal. General Nieto, made forays through the north with dispatches from the Supreme Chief issued by Orbegoso, sharing the position between the two. Santa Cruz, through his cunning, managed to maintain the rebel state as an autonomous republic by turning it against the restorative allies, causing the imminent invasion of northern Peru. The restorers advanced on Lima and despite the opposition of Nieto (who rightly feared the numerical superiority of the enemy) the Battle of Portada de Guías took place on August 21, 1838 in which the Orbegosistas were defeated. After the conquest of northern Peru by the restorers, Agustín Gamarra was proclaimed as provisional president. A year later, the confederates launched a reconquest campaign in the north, causing the restorers to flee and re-annexing the territory of northern Peru. Peruvian Republic (1838–1841)

The Peruvian Republic, presided over by Agustín Gamarra, was the second Peruvian provisional government, backed by the United Restoration Army, which had the objective of restoring Peru as an independent unit. The seven presidents
By September 1838, the Confederation's stability had collapsed, as Peru (i.e. North and South Peru) was under the de jure control of seven different presidents at one time, who held varying degrees of power: Santa Cruz, who was the Supreme Protector; Gamara, the restorationist president; Orbegoso, leader of the seccessionist North Peruvian state; José de la Riva Agüero, who replaced Orbegoso, being appointed by Santa Cruz; Pío de Tristán, president of South Peru; Domingo Nieto, in the north; and Juan Francisco de Vidal in Huaylas. Consequences
After the disunity between Peru and Bolivia and the fatal outcome of the war, both countries distanced themselves and began the process of delimiting their borders until the beginning of the Guano Era and the commercial rapprochement of these countries with Chile. In 1873, Peru and Bolivia sealed the Treaty of Defensive Alliance to protect their commercial interests. In Peru, after the war and the defeat of the Confederation in the Battle of Yungay, the new Peruvian provisional government of Agustín Gamarra, with the protection of the Chilean Army, declared the dissolution of the Confederation on August 25, 1839, initiating the so-called national restoration and creating the New Constituent General Congress of Peru. He substituted the confederate organization with a unitary organization, withdrew Bolivian public workers, and rebuilt Peru's international relations. References

Bibliography
 
 

Peru–Bolivian Confederation
War of the Confederation
Peru–Bolivian Confederation