* In 1838, France invaded Mexico in the Pastry War, a conflict sparked by the non-payment of debts owed to French citizens by the Mexican government. The French blockaded Mexican ports and captured the port city of Veracruz. The war ended with the signing of the Treaty of Guadalupe Hidalgo in 1848, which resulted in Mexico ceding a large portion of its territory to the United States.
United States
* The United States invaded Mexico in 1846, starting the Mexican-American War. The war was caused by several factors, including the annexation of Texas by the United States, disputes over the Texas-Mexico border, and American desire for more land in the West. The war ended with the signing of the Treaty of Guadalupe Hidalgo in 1848, which resulted in Mexico ceding a large portion of its territory to the United States.
* The United States also invaded Mexico in 1861, during the American Civil War. The Union Army invaded Mexico in an attempt to capture Confederate President Jefferson Davis, who had fled to Mexico after the fall of the Confederacy. The Union Army was unsuccessful in capturing Davis, and the invasion ended with the withdrawal of Union troops in 1867.
Spain
* Spain invaded Mexico in 1829, in an attempt to regain control of Mexico after it had gained independence from Spain in 1821. The Spanish invasion was unsuccessful, and Spain was forced to withdraw its troops in 1830.