806 and 1807, but were defeated both times by Santiago de Liniers. Those victories, achieved without help from mainland Spain, boosted the confidence of the city.
The beginning of the Peninsular War in Spain and the capture of the Spanish king Ferdinand VII created great concern all around the viceroyalty. It was considered that, without a King, people in America should rule themselves. This idea led to multiple attempts to remove the local authorities at Chuquisaca, La Paz, Montevideo and Buenos Aires, all of which were short-lived. A new successful attempt, the May Revolution, took place when it was reported that all of Spain had been conquered, with the only exception of Cádiz and León.
Buenos Aires became the capital of the Viceroyalty of the Río de la Plata in 1776, with territories from the Viceroyalty of Peru. Buenos Aires and Montevideo resisted two ill-fated British invasions in 1806 and 1807. The resistance was headed both times by the French Santiago de Liniers, who would become viceroy through popular support. The ideas of the Age of Enlightenment and the example of the Atlantic Revolutions generated criticism to the Absolute monarchy. The overthrow of the Spanish King Ferdinand VII during the Peninsular War created great concern in the Americas, so many cities deposed the monarchic authorities and appointed new ones, working under the new political ideas. This started the Spanish American wars of independence across the continent. Buenos Aires deposed the viceroy Baltasar Hidalgo de Cisneros in 1810, during the May Revolution.
Independence and civil wars
The May Revolution began the Argentine War of Independence between patriots and royalists. The Primera Junta, the new government in Buenos Aires, sent military campaigns to Córdoba, Upper Peru and Paraguay, and supported the rebellions at the Banda Oriental. The military campaigns were defeated, so Buenos Aires signed an armistice with Montevideo. Paraguay stayed