May Revolution
The May Revolution was a direct reaction to Spain's Peninsular War. In 1808, King Ferdinand VII of Spain abdicated in favor of Napoleon, who granted the throne to his brother, Joseph Bonaparte. A Supreme Central Junta led resistance to Joseph's government and the French occupation of Spain, but eventually suffered a series of reversals that resulted in the Spanish loss of the northern half of the country. On February 1, 1810, French troops took Seville and gained control of most of Andalusia. The Supreme Junta retreated to Cadiz and dissolved itself, and the Council of Regency of Spain and the Indies replaced it. News of these events arrived in Buenos Aires on May 18, brought by British ships.
May Revolution
Former Viceroy Santiago de Liniers organized a counter-revolution in Córdoba, and this became the first military campaign of the independent government. Despite the importance of Liniers himself, and his prestige as a popular hero for his role when the British invaded, the population of Córdoba preferred to support the revolution. This reduced the power of the counter-revolutionary army by means of desertions and sabotage. Liniers's troops were quickly defeated by the forces led by Francisco Ortiz de Ocampo. Ocampo refused to shoot the captive Liniers; hence the execution ordered by the Junta was carried out by Juan José Castelli. After the victory, the Primera Junta sent military expeditions to many other cities, to demand support and the election of representatives to it.
Montevideo, which had a historical rivalry with Buenos Aires, opposed the Primera Junta and the Council of Regency declared it the new capital of the Viceroyalty, along with Francisco Javier de Elío as the new Viceroy. The city was well defended, so it could easily resist an invasion. Peripheral cities in the Banda Oriental acted contrary to Montevideo's will and supported the Buenos Aires Junta. José Gervasio Artigas led them, and kept Montevideo under siege. The final defeat of the Montevidean royalists was carried out by Carlos María de Alvear and William Brown.