Following the May Revolution of 1810, the Viceroy had been replaced by the Primera Junta. The provinces had been moving towards full independence but royalist forces from the Viceroyalty of Peru have had the upper hand in the Upper Peru and were threatening the revolution.