Established in 1871, the town was named for Mexican General José Antonio Mexia, whose family donated the town site. The General first served under Santa Anna but later joined an uprising against the Mexican dictator. The rebellion failed, and the city's namesake was executed by a firing squad. Natural gas was discovered nearby in 1912, and an oil gusher blew in nine years later. The resulting boom ushered in a rowdy period marked by violence and martial law.
Mexia marks the country's independence with its Boomin' on the Fourth Celebration and a rodeo held the last weekend in June.