In 1519, the Spanish took Moctezuma, Cacamatzin (ruler of Texcoco), Cuitlahuac and other nobles as prisoners. Cortés was then forced to return to Veracruz to face Spanish authorities, leaving Pedro de Alvarado in charge. Alvarado had hundreds of Aztec nobles killed. After Cortés returned, he liberated Cuitláhuac in exchange for supplies, allowing the lord to organize an army against the Spanish. Cuitlahuac succeeded Moctezuma as Aztec emperor and forced the Spanish to flee during the Noche Triste. However, Cuitlahuac was ruler only somewhere between 40 and 80 days according to various records. He spent that time repairing the city of Tenochtitlan as the Spanish regrouped in Tlaxcala. Cuitlahuac died of smallpox in December 1520, with Cuauhtémoc succeeding him.