Mexico City served as the capital of the French-backed empire under Maximilian.
The Second Mexican Empire was established after French forces captured Mexico City in 1863 and installed Maximilian, an Austrian archduke, as emperor. Mexico City became the imperial capital, while Benito Juárez and republican supporters continued fighting from other parts of the country.
Maximilian and his wife, Carlota, used Chapultepec Castle as their principal residence. The imperial government tried to present itself as a stable national authority, but it depended heavily on French military support and never controlled all of Mexico.
The empire ended after France withdrew its troops. Republican forces captured Mexico City in 1867, and Maximilian was executed at Querétaro later that year. Cinco de Mayo celebrates an earlier Mexican victory that delayed, but did not permanently prevent, the French advance toward the capital.