Prior to the Spanish conquest the territory included in the modern department formed a part of the K'iche' Kingdom of Q'umarkaj. The kingdom was defeated by the Spanish under Pedro de Alvarado in a number of decisive battles fought near the city of Quetzaltenango, then known as Xelaju. In the 19th century the territory of the modern department was included in the short-lived Central American state of Los Altos. The department was created by decree in 1845, five years after the fledgling state was crushed by Rafael Carrera.