At first I hesitated to write "Happy Cinco de Mayo, all you Mexicans!" as this article's title because I thought my American friends might think I was racist for openly using the "M" word. Turns out though, that Mexicans wear this label proudly.
My ethnocentrism actually shows itself more in assuming Mexicans celebrate Cinco de Mayo at all. It's much more of an American holiday, falsely assumed to be Mexico's "Fourth of July" (Mexican Independence Day is Sept. 16). In Mexico, you might find a fiesta in the state of Puebla, if at all.
Mexico had been independent from Spain for almost half a century when the Battle of Puebla was won on May 5, 1862. This war with France began the previous year when Mexican President Benito Juárez refused to pay interest on some international debts because of national bankruptcy. Spain and Britain were also owed money and tried to collect, but France was more aggressive and used the nonpayment as an excuse to occupy Mexico (coveting some rich mines in Mexico's northwest).
The Battle of Puebla came early in the war, and wasn't really terribly decisive. It only delayed France's invasion of Mexico City. Presidente Juárez escaped and formed a government-in-exile in Chihuahua while one of the Hapsburgs (the younger brother of the Emperor of Austria, Franz Joseph, whose heir would later cause World War I by being assassinated) was proclaimed Emperor Maximilian I of Mexico in 1864.
Establishing Max as the monarch was the Mexican conservatives' idea. They wanted a return to the good ol' days of royalty, but they weren't pleased when they learned how progressive his Highness was. He favored a limited monarchy sharing powers with an elected congress and brought about laws abolishing child labor, limiting work hours, and lifting Indians out of serfdom. He didn't have many friends in the liberal camp either though, since that included Juárez and the people who opposed monarchy. Still, he developed a strong allegiance to his new nationality and displayed an affinity for his people. Later in the conflict, Maximilian offered Juárez amnesty and even the post of prime minister, but was turned down.
Juárez's forces began making a comeback in 1865, which coincidentally marked the end of the U.S. Civil War. Without this distraction, President Andrew Johnson dispatched troops to the border and made it clear to the French that the U.S. opposed the Mexican monarchy. He had a hard time cooperating with Congress (our first impeached president!), so he ordered the Army to "lose" some 30,000 muskets "near" the Mexican border. Largely because of the United States' moves, France began pulling out of Mexico in late 1866.
Maximilian was captured in an escape attempt and sentenced to death on May 15, 1867. This was justified by his infamous "Black Decree" issued a year and a half earlier threatening any captured Mexican Republican with immediate execution. In spite of pleas via telegram from royals in Europe, and even though Juárez liked Maximilian on a personal level, he enforced the execution as a message that Mexico would not tolerate governments imposed by foreign powers. Facing the firing squad, Max's last words were, "Mexicanos! I die in a just cause... the independence and liberty of Mexico. May my blood be the last to flow for the good of this land. Viva Mexico!"