Mexico went to war with France in the 19th century.
The second French intervention in Mexico ( Segunda intervención francesa en México ) , also known as the Maximilian Affair , Mexican Adventure , the War of the French Intervention , the Franco-Mexican War or the Second Franco-Mexican War , was an invasion of Mexico in late 1861 by the Second French Empire , supported in the beginning by the United Kingdom and Spain . Mexico . The Mexican -- American War ( 1846 -- 48 ) led to the territorial cession of the extensive northern territories to the United States . The Pastry War , the Franco-Mexican War , a civil war , two empires and a domestic dictatorship occurred through the 19th century .