With the outbreak of the Mexican War of Independence, authorities arrested the head of Indian communities along with suspected insurgents in October 1810. This was despite the fact that Nahua groups had organized to defend against the insurgents upon hearing that they were enemies of the king and planned to destroy churches. One accused insurgent was José Antonio Díaz, the parish priest of Almoloyán and friend of Miguel Hidalgo y Costilla. Later he would join the insurgent army. During the war, the city of Colima was taken by the insurgents Jose Antonio Torres at the end of 1810 without resistance and taken back by the royalist army in 1811. In 1811, royalist troops defeated the insurgents under José Calixto Martinez at the Battle of Los Llanos de Santa Juana. Insurgents took back the city in 1812 under the command of Ignacio Sandoval and Miguel Gallaga. In 1813, the city was in royalist hands with the city swearing allegiance to the monarchist constitution. In 1821 the Plan of Iguala for Mexican independence was proclaimed in the city, and accepted by local authorities. Immediately after Independence, Colima was still a subdelegation of Guadalajara. In 1821, Colima lost the Zapotlán areas along with the towns of Tecalitlán and Xilotlán, but gained the town of Tonila. This and earlier losses of territory would define the area's modern borders.