In September of that year, Carrera attempted an assault on the capital of Guatemala, but the liberal general Carlos Salazar Castro defeated him in the fields of Villa Nueva and Carrera had to retreat. After unsuccessfully trying to take Quetzaltenango, Carrera found himself both surrounded and wounded. He had to capitulate to Mexican General Agustin Guzman, who had been in Quetzaltenango since Vicente Filísola's arrival in 1823. Morazán had the opportunity to shoot Carrera, but did not, because he needed the support of the Guatemalan peasants to counter the attacks of Francisco Ferrera in El Salvador. Instead, Morazán left Carrera in charge of a small fort in Mita, without any weapons. Knowing that Morazán was going to attack El Salvador, Francisco Ferrera gave arms and ammunition to Carrera and convinced him to attack Guatemala City.