In July, 1820, the indigenous residents of Totonicapán revolted against the government in response to excessive tributes imposed by the Spanish King Ferdinand VII. The Totonicapán Uprising of 1820 was led by Atanasio Tzul and Lucas Aguilar. After toppling the local government, Tzul declared himself king of the breakaway province, with Aguilar as president. The mayor of neighboring Quetzaltenango, Prudencio Cózar, along with hundreds of armed men, led an invasion to put down the rebellion. The rebel government lasted about 20 days. The rebels were captured, whipped, and imprisoned.