The Republic of North Peru was one of the three constituent Republics of the short-lived Peru–Bolivian Confederation of 1836–1839. North Peru was formed from the division of the Republic of Peru into the Republic of North Peru and the Republic of South Peru. These two Republics were founded in 1836 to be (with the Republic of Bolivia) constituent Republics of the Peru-Bolivian Confederation. The Confederation came to an end three years later after continuous border wars with Argentina and Chile in the War of the Confederation, and after a chaotic civil conflict between north and south Peruvians. In August 1839, Agustín Gamarra declared the Confederation dissolved; as a result, South Peru and North Peru reverted to being a unified Republic of Peru. Background The Peru-Bolivian Confederation was a plan that attempted to reunite the Alto Perú ("Upper Peru", now Bolivia) and Bajo Perú ("Lower Peru", now simply Peru) into a single political and economic entity. Marshal Andrés de Santa Cruz promoted an ambitious project to reunite these two territories on the basis of a confederacy. This integration was based not only on historical, cultural and ethnic reasons but also on sound economic motives. The union was trying to restore the ancient commercial routes and promote a policy of open markets. As President of Bolivia, Santa Cruz instigated several failed plots to achieve a political union with Peru, taking advantage of that country's chronic political unrest. His best opportunity came in 1835 when the Peruvian President General Luis José de Orbegoso requested his assistance to fight the rebel armies of Generals Agustín Gamarra and Felipe Santiago Salaverry. Santa Cruz defeated Gamarra at the Battle of Yanacocha on and Salaverry at the Battle of Socabaya on . With Bolivian help, General Orbegoso quickly regained his leadership throughout the country and had Salaverry summarily executed. In retribution to the support he received from Santa Cruz, he acceded to the formation of the new Peru–Bolivian Confederation. Santa Cruz assumed the Supreme Protectorship of the confederation and Orbegoso maintained only the presidency of the newly created Republic of North Peru. Creation At the instigation of Santa Cruz, a Congress of the Peruvian northern departments (Amazonas, Junín, La Libertad, and Lima) gathered at Huaura founded the Republic of North Peru on . Then, together with South Peru, they recognized Santa Cruz as Supreme Protector with extensive powers that enabled him to create the Peru-Bolivian Confederation on