Mexico's war with France didn't begin in 1838.
Maximilian ( Spanish : Maximiliano ; born Ferdinand Maximilian Joseph ; 6 July 1832 -- 19 June 1867 ) was the only monarch of the Second Mexican Empire . 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 .