This Sunday is Cinco de Mayo (May 5), but what exactly does that mean? Contrary to widespread belief, Cinco de Mayo is actually not Mexico’s Independence Day. Mexico’s Independence Day is actually held on Sept. 16. In reality, Cinco de Mayo commemorates El Día de la Batalla de Puebla (The Day of the Battle of Puebla), when the Mexican army defeated the much larger invading French army in 1862. Read on to find out more about the history of Cinco de Mayo.

By the 1860s, the Mexican government was very close to broke. After the Mexican-American War from 1846 to 1848, the Mexican Civil War of 1858 and the Reform Wars in 1860, the government was simply out of cash. So in 1861, liberal Mexican President Benito Juárez decided to stop paying all of Mexico’s foreign debt for two years in order to build up a reserve of funds.

France’s Emperor Napoleon III was, to say the least, extremely unhappy by this decision. The emperor was already upset with Mexico’s decision to abolish slavery, and sought to use the opportunity to install a Mexican Empire sympathetic to French interests. By late 1861, the United States, which had barred European intervention in the New World under the Monroe Doctrine, was sidelined by its own Civil War, and several thousand French troops landed on the Gulf coast with the intention of marching up through the mountains to capture Mexico City.

This ultimately led to the Battle of Puebla, near the city of Puebla on May 5, 1862. In the battle, the 4,500 underequipped Mexican soldiers were able to hold off a much larger, much better-equipped French forces of more than 6,500 soldiers. In the end, only 83 Mexican soldiers were killed, according to Mexico Online. It was a major victory against the French army and a serious morale boost for the Mexican forces.

Unfortunately for Mexican patriots, however, the Battle of the Puebla simply was not enough to hold off the invading French forces. A year later, 30,000 French soldiers took Mexico City and installed Maximilian, an Austrian prince, as emperor of Mexico. The empire only lasted until 1867, however, when Juárez retook Mexico City and Maximilian was executed.

So there you have it, the real history behind Cinco de Mayo. But what made the commemoration of this battle such a large holiday in America?

Oddly enough, while Cinco de Mayo is by far the biggest celebration of Mexican heritage in the United States, it remains a relatively unimportant holiday in Mexico itself, save for the state of Puebla. Instead, in Mexico, citizens celebrate their actual Independence Day on Sept. 16 in honor of the 1810 declaration of independence from Spain.

So how did Cinco de Mayo become such a popular celebration in the United States? No one is quite sure, but according to UCLA professor David Hayes-Bautista, it all comes down to a Civil War-era Mexican heritage group. In 1860s Los Angeles, the Juntas Patrióticas Mejicanas supposedly introduced the celebration as a way to raise awareness of Mexican heritage and history in Southern California, which the U.S. took from Mexico in 1848. Since then, the holiday has spread across the United States, leading to all of the parties we see today.