The American Civil War didn't end in 1865. It wasn't over until Mexican national forces threw out the French and their puppet Emperor of Mexico, Maximilian I, in 1867.
While the United States was preoccupied with a southern states rebellion, France's Napoleon III invaded Mexico and installed a puppet emperor supported by the French Foreign Legion. When the Union finished putting down its rebellion, it turned its attention to the French in Mexico. General Phil Sheridan, the fierce little Irishman, was sent with a vast naval armada to the Rio Grand, including thousands of troops and the powerful African-American XXV Corps, which had played a critical role in trapping Robert E. Lee at Appomattox.
Sheridan merrily started leaving huge quantities of arms and ammunition at the border for Juarez and his Mexican national army to retrieve. Then Sheridan told his soldiers that they'd be allowed to leave the army before their enlistments were up if they joined the Mexicans. The Mexicans were offering generous bonuses for new recruits with military experience. Before long the French were on the run.
Intriguing that Mexicans, blacks and a fierce little Irishman joined forces to preserve Liberte, Egalite, Fraternite, n'est-ce pas?