<P> Carlota Joaquina, sister of the Spanish king Ferdinand VII and married to the regent prince of Portugal, sought to take advantage of the Peninsular War to rule over the Spanish territories . Her project, however, was resisted and did not succeed . </P> <P> Buenos Aires ousted the viceroy Baltasar Hidalgo de Cisneros and began the Argentine War of Independence, renaming the territory as the United Provinces of the Río de la Plata . However, other territories stood against Buenos Aires, staying loyal to the Spanish rule, and the actual status of each zone depended upon the military conflicts; Paraguay and the Upper Peru (modern Bolivia) could resist Buenos Aires . Spain declared Buenos Aires a rogue city and appointed Montevideo as the new capital of the Viceroyalty, but Javier de Elío was sieged by Buenos Aires and the rural populations, and could not maintain authority beyond the Banda Oriental (modern Uruguay). Montevideo would be finally captured by William Brown and Alvear . </P> <P> The battle of Cepeda ended the authority of the Spanish colonial Supreme Directors in 1820, and for a period of time there was no head of state in the country . Juan Manuel de Rosas united the provinces in the federal pact, so that the governor of Buenos Aires Province managed international relations, acting similarly to a head of state of the country until a Constitution was written . The United Provinces were then renamed as the Argentine Confederation . </P> <P> The Upper Peru was a disputed area even before the war . It had long been related to Lima, capital of the Viceroyalty of Peru . Charles III removed it from that viceroyalty and assigned it instead to the Viceroyalty of the Río de la Plata . However, commercial and cultural ties stayed stronger with Lima than with Buenos Aires, the new capital . </P>

Who led the rebellion in rio de la plata