|This article covers a war or battle
However, the C.S. was lustful of fulfilling its own Manifest Destiny and expanding into South America and the Caribbean to establish a "Tropical Empire" (a concept of a mass slave and agricultural empire for the CS), and sought to buy the Mexican states of Chihuahua and Senora for $30 million. However, Maximilian respectfully refused such an offer, stifling the CSA's imperial dreams. This would incite a growing belief in the Confederacy that it was its right to expand into Mexico and tame the supposedly inferior people's that inhabited it. The ideological differences between the Confederate republic and Mexican empire and the Confederate's support of republican secession movements from the populations of the Yucatan and the Rio Grande would also spur distrust and conflict. It seemed only a matter of time before something would set off the tensions.
The Mexican Empire had also had tensions with William Walker since Maximilian had taken the throne. Walker at first had been little more than a filibuster nuisance who had set up an illegitimate rule in Nicaragua (seemingly for the sole purpose of slavery and his own glory) which seemed destined to fall to one of nations between Mexico and itself. However, Walker's mercenary army blitzed across Central America, leading the its subjugation under Walker's illiberal throne. This was thanks in large part to Walker's support of Vanderbilt's Transit Company's charter, curtailing the wraith of a possible intervention on Vanderbilt's part. Soon, the conquest of Guatemala, Honduras, and Costa Rica would be complete, and Walker would reform his empire under the United Republic of Nicaragua, Guatemala, Honduras and Costa Rica (later renamed the United Provinces of Central America); only El Salvador and Panama remained free. Nothing stood between Walker and Mexico.
Walker, a conservative minded Southerner who fully supported slavery (and whose exploits inspired the Confederates of the prospect of a Southward cotton empire), had likewise allied with the Confederacy, offering aid during the War of Secession and breaking the North's blockade around the South's southern coast. However, the Confederates had remained steadfastly allied to this anglo-saxon's Republic, while slowly reclining its relations with Mexico.
In 1879, Mexico declared war on the URNGHC over border disputes and incursions Walker had made into Mexican land over the decade, as well as the prospect of liberating the conquered Hispanics of Walker's republic. However, Walker claimed that the war was an exercise in Mexico's own aggression, and the Confederates, increasingly spiteful of Mexico and seeing this as a chance for expansion, agreed. On May 14, 1879, the CSA formally declared war on the Mexican Empire.
In the following months, the Empire of Mexico fought to stave off a two front war. To the North, the Confederacy swept southward, making quick gains in Coahuila, Nuevo Leon, Tamaulipas, which it reformed into the puppet "Republic of the Rio Grande". To the south, Mexico led a more offensive war against Walker as it already occupied Guatemala. Thanks largely to Maximilian's industrialization and military build up over the decade and the disunity the Confederates were still trying to overcome, Mexico was able to do moderately well in the war and had the prospect of victory. But by 1880, it looked as though the CSA would break through the Mexican defensive lines south of the Republic of the Rio Grande. In desperation, Maximilian sought aid in the nation it had helped balkanize two decades before... the United States.
The United States was conflicted in offering its support. On the one hand, Mexico had lent its hand in the Yankees' loss of the War of Secession and helped create the situation North America now faced, and the Northerners for decades considered Maximilian little more than a "Tinpot Emperor". On the other, if Mexico managed to beat back the Confederates, it would strike a blow at the Dixan republic and could lead to an ally. In the end, the United States decided to lend its aid to Mexico.
The United Kingdom of California was also approached for support, and was willing to offer aid should Mexico agree to allow it to expand into land in Baja California. Mexico relented, and the Californians send supplies and arms into the Empire.
By May, supplies and arms were crossing the border through New Mexico, and military advisers were being sent to train the armies of Maximilian. The United States also supplied black revolutionary forces in the CS to distract their war effort.
By 1883, Mexico broke through the Confederate lines south of the Rio Grande Republican line, and made headway toward the Rio Grande river, taking Coahuila, Nuevo Leon, and Tamaulipas by the fall. It soon was apparent that Mexico could cross into Texas if given enough time. The War was also proving unpopular within the Confederacy as its quick gains quickly fell into a seemingly unending conflict at the southern border of the Republic of the Rio Grande.
In February of 1883, Mexico and the CS signed the Second Treaty of Guadalupe Hidalgo, ending the war in a ceasefire between the two powers, and re-establishing ante-bellum territorial claims, including the reabsorption of the Rio Grande Republic. By May, Mexico would also conclude a peace with URNGHC, ending with Guatemala being given independence and proclaimed a protectorate of Mexico. Relations between the US and Mexico would prove stable for decades afterward, with even the CSA becoming once again a friend of Mexico.