Mexico's war with France began in the 1830's.
Mexico . Three centuries later , this territory became Mexico following recognition in 1821 after the colony 's Mexican War of Independence . 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 . The Pastry War ( Guerra de los pasteles , Guerre des Pâtisseries ) , also known as the First French intervention in Mexico or the First Franco-Mexican War ( 1838 -- 1839 ) , began in November 1838 with the naval blockade of some Mexican ports and the capture of the fortress of San Juan de Ulúa in Veracruz by French forces sent by King Louis-Philippe .