During the Spanish Colonial period, Chapultepec Hill was still considered to be one of the area's most beautiful places, suitable for retreats. In 1785, under the rule of New Spain’s Viceroy Bernardo de Gálvez, construction began on a country house at the top of Chapultepec Hill. The architect in charge was Lieutenant Colonel of the Spanish Army and engineer Francisco Bambitelli. When Bambitelli had to depart to Havana, Cuba, the Captain of the infantry and engineer Manuel Agustín Mascaró took over the project (Museo). Despite rapid progress on the project, Viceroy Bernardo de Gálvez died in 1786 before its completion; it was speculated that he was poisoned for actually designing a fortress, rather than a country house, from where he could lead a revolt against the Spanish Crown (Zavala).
As a result, the Crown ordered a halt to the construction and attempted to auction it off at the price of 60 thousand pesos (even though they had already spent over 300 thousand pesos on its construction up to that point) (Zavala). Due to a lack of interest in the building, Viceroy Juan Vicente de Güemes Pacheco y Padilla, the 2nd Count of Revillagigedo, ordered that the building be used to house the Kingdom of New Spain’s General Archive. This project also failed (Zavala).
In 1806, Mexico City’s municipal government finally purchased the building and surrounding forest (Zavala). The building remained abandoned, however, during Mexico’s War of Independence. In 1833, it became the Military Academy.
Due to the strategic location and fortress-like surroundings of the building, Chapultepec Castle served as a military post during the Mexican American War (1846-1848) and stood as Mexico City’s last line of defense against the US American army. The Battle of Chapultepec (Sept. 12-13, 1847) was the last battle before the US captured Mexico City, ending the war (for more on significant battles and battle plan maps of the Mexican American War, including the Battle of Chapultepec, see the module: Maps of the Mexican American War).