Porfirio Díaz became president after commanding Mexican forces during the French intervention.
Díaz served as a Mexican military officer during the conflict with France. He fought in the defense of Mexico and later helped republican forces defeat the French-backed Second Mexican Empire. His military career included important actions during the prolonged intervention, even though Ignacio Zaragoza commanded the Mexican army at the Battle of Puebla itself.
Díaz first became president in 1876 and dominated Mexican politics for much of the period known as the Porfiriato. He held office for multiple terms, with an interruption, until the Mexican Revolution forced his resignation in 1911. His government encouraged railways, foreign investment, and economic modernization, but also faced criticism for authoritarian rule and inequality.
Díaz is therefore connected to Cinco de Mayo through the wider French intervention, not as the commander of the Puebla battle. That distinction separates him from Zaragoza, who led the Mexican force on May 5, 1862.