Answer based on context:

Christopher Columbus discovered the Americas for the Kingdom of Castile and León in 1492. By 1580 this had unified with neighbouring kingdoms to form one Spanish kingdom. Private adventurers thereafter entered into contracts with the Spanish Crown to conquer the newly discovered lands in return for tax revenues and the power to rule. In the first decades after the discovery, the Spanish colonised the Caribbean and established a centre of operations on the island of Cuba. They heard rumours of the rich empire of the Aztecs on the mainland to the west and, in 1519, Hernán Cortés set sail with eleven ships to explore the Mexican coast. By August 1521 the Aztec capital of Tenochtitlan had fallen to the Spanish. Within three years of the fall of Tenochtitlan the Spanish had conquered a large part of Mexico, extending as far south as the Isthmus of Tehuantepec. The newly conquered territory became New Spain, headed by a viceroy who answered to the Spanish Crown via the Council of the Indies. Cortés despatched Pedro de Alvarado with an army to conquer the Mesoamerican kingdoms of the Guatemalan Sierra Madre and neighbouring Pacific plain; the military phase of the establishment of the Spanish colony of Guatemala lasted from 1524 to 1541. The Captaincy General of Guatemala had its capital at Santiago de los Caballeros de Guatemala and covered a wide territory that also included the Mexican state of Chiapas as well as El Salvador, Honduras and Costa Rica. The Spanish imposed colonial rule over Yucatán between 1527 and 1546, and over Verapaz from the 16th to the 17th centuries, leaving the area between - essentially Petén and much of Belize - independent long after surrounding peoples had been subjugated.

How many total years did the military phase of the establishment of the Spanish colony of Guatemala last?
17