He defended the settlement against a second British invasion and a mutiny that sought to replace him. He was replaced in 1809 by Baltasar Hidalgo de Cisneros, appointed as viceroy by the Junta of Seville, and retired from public activity. But when the May Revolution took place, Liniers decided to come out of his retirement and organized a monarchist uprising in Córdoba. Liniers was forced to flee, but was eventually captured, and executed without trial.