Chapultepec Castle, along with Iturbide Palace, also in Mexico City, are the only royal palaces in North America which were inhabited by monarchs.
It was built during the Viceroyalty of New Spain as a summer house for the highest colonial administrator, the viceroy. It was given various uses, from a gunpowder warehouse to a military academy in 1841. It was remodeled and added to and became the official residence of Emperor Maximilian I of Mexico and his consort Empress Carlota during the Second Mexican Empire (1864–67).