Bolivia–Spain relations and Antonio José de Sucre entered Peru and defeated the Spanish forces in the country. Soon afterwards, troops led by Antonio José de Sucre entered Upper Peru and fought against royalist forces. By 1825, Upper Peru was free from Spanish authority. Originally, Bolívar wanted Upper Peru to join either Peru or Argentina, however, the people of Upper Peru convinced Bolívar and Sucre to give autonomy to the territory and on 6 August 1825, an Upper Peruvian congress declared the country independent and renamed the territory "Bolivia" in honor of Simón Bolívar and named its capital "Sucre" in honor of Antonio
Trujillo, Peru only stable and productive area that could organize and lead the nascent republic. The department encompassed nearly half the country. For the efforts of its people in the war of emancipation, San Martín gave it the title of "Meritorious City Loyal to the Homeland". The municipality of the city, then called a "cabildo", was given the rank of "honorable". In 1823, after the creation of the Republic of Peru, the protectorate of José de San Martín was developed. Before royal troops took the city of Lima, the first President of Peru, Don José de la Riva Agüero, together with Sánchez