The Spanish king Ferdinand VII was captured during the Peninsular War, and replaced by the French Joseph Bonaparte. He was not recognized as a legitimate king, which left the Spanish monarchy without a ruler. This generated political reactions all across the Spanish Empire. Despite being of French ancestry, Liniers rejected Joseph's rule and confirmed his allegiance to the captive king, but Javier de Elío did not trust him, and created a government Junta in Montevideo. Martín de Álzaga, Elío's ally in Buenos Aires, attempted to do the same by organizing a mutiny, but failed. Elío gave up his junta when Liniers was replaced by a new viceroy, Baltasar Hidalgo de Cisneros. However, as the Spanish situation in the Peninsular War worsened, Buenos Aires deposed Cisneros during the May Revolution and create their own junta. This started the Argentine War of Independence. Montevideo was declared then the new capital of the viceroyalty, and became a Royalist stronghold. The other populations of the Banda Oriental, however, did not join Montevideo. Led by José Gervasio Artigas, they made the cry of Asencio and laid siege to the city until its defeat.