Human settlement on the present site of Guatemala City began with the Maya who built a city at Kaminaljuyu. The Spanish colonists established a small town, which was made a capital city in 1775. At this period the Central Square with the Cathedral and Royal Palace were constructed. After Central American independence from Spain the city became the capital of the United Provinces of Central America in 1821.
The 19th century saw the construction of the monumental Carrera Theater in the 1850s, and the Presidential Palace in the 1890s. At this time the city was expanding around the 30 de junio Boulevard and elsewhere, displacing native settlements from the ancient site. Earthquakes in 1917–1918 destroyed many historic structures. Under Jorge Ubico in the 1930s a hippodrome and many new public buildings were constructed, although peripheral poor neighborhoods that formed after the 1917–1918 earthquakes continued to lack basic amenities.
During the Guatemalan Civil War, terror attacks beginning with the burning of the Spanish Embassy in 1980 led to severe destruction and loss of life in the city. In May 2010 two disasters struck: the eruption of the Pacaya volcano, and two days later Tropical Storm Agatha.
Humans have long inhabited and settled in the areas in and around modern-day Guatemala City. Upon the advent of agriculture, some of these early Neolithic settlements grew to become large, stratified cities. Testimony of this can be seen in the western suburbs of Guatemala City, where the ruins of the central ceremonial center of the Preclassic Maya city of Kaminaljuyu are located. Archeological evidence demonstrates that Kaminaljuyu was first occupied by the Maya around 1500 BC, with the site being continuously inhabited until around 1200 AD.