In 1521, smallpox wiped out one-third of the Quiche Mayan population. Three years later, Pedro de Alvarado, who was a captain for Cortes, advanced on Guatemala. He allied himself with the Cakchiquel Maya and defeated a Quiche Mayan army of 30,000. The Quiche were no match for the armored calvary charges, lances, guns, cannons, and steel swords. The Spaniards waited until 1527 before they attempted to conquest the Mayans. The Mayans won some smaller battles, but at Ake more than 1,000 Mayans were killed in a single battle. In 1542, Merida became the first permanent town on the Yucatan Peninsula.