Its name comes from the Nahuatl for "on the hill of the grasshopper", and the hill was a sacred place for the Aztecs long before anything was built on it. In the two centuries since, the building has been a viceroy's country house, a military academy, an emperor's palace, an observatory and the home of Mexico's presidents.
Viceroy Bernardo de Gálvez ordered a summer residence on the highest point of the hill in 1785, but he died the following year, the Crown tried and failed to sell the half-built house, and it passed to the city in 1806. Abandoned during the War of Independence, it became the Military College in 1833, when the watchtower called the Caballero Alto was added. On 13 September 1847, during the Mexican-American War, United States forces stormed the castle; the young cadets who died defending it are remembered as the Niños Héroes, and a large mural in their honour fills the ceiling above the main entrance.
The palace that visitors see owes much to Emperor Maximilian I and Empress Carlota, who made it their residence in 1864 during the Second Mexican Empire. Maximilian brought in European and Mexican architects, among them Julius Hofmann and Carl Gangolf Kayser, to remodel it in a neoclassical style; the botanist Wilhelm Knechtel laid out a roof garden, and furniture and fine objects shipped from Europe are still on display, along with Carlota's bedroom. To link the castle with the city centre, Maximilian laid out a straight boulevard named for the empress, renamed Paseo de la Reforma after the Republic returned in 1867.
In 1882 President Manuel González made the castle the presidential home, and nearly every head of state lived here until Lázaro Cárdenas chose Los Pinos in 1934 and turned the castle over to the National Museum of History, which opened to the public on 27 September 1944. Inside are period rooms, stained glass along the corridors and historical collections such as dresses from the viceregal era; the garden around the Caballero Alto looks out from the summit. In 1992 the castle was also where the Chapultepec Peace Accords ending the Salvadoran civil war were signed.




