 In AD 1525 the city was attacked by Spanish conquistadors under Gonzalo de Alvarado y Contreras during a siege that lasted several months . Kayb 'il B 'alam , the city 's last ruler , finally surrendered to the Spanish due to starvation . 
