Ahualulco was founded in 1542 by Cristobal de Oñate in a region that had been inhabited in pre-Columbian times by the Chichimeca people. The first church was constructed in the area beginning in October 1574. The community got its start in early 1799 with residents from the nearby La Estancia and Hacienda de Bocas areas. The town originally was part of the state of Zacatecas.
In 1846, the Count of Peñasco sold the Hacienda de Bocas to Juan de Dios Pérez Gálvez, prompting living conditions to worsen significantly. The next year, residents revolted, sacking the tax office, the church and major houses in the area; the revolt was crushed by the local government with the support of that of Aguascalientes. The current parish would be constructed in 1857.
In 1858, Zacatecas and San Luis Potosí exchanged municipalities, with San Luis Potosí taking on Ahualulco and Zacatecas picking up the municipality of Ojocaliente that previously belonged to San Luis Potosí. On August 16, 1859, Ojocaliente was formally denominated a villa as Ahualulco de Pinos. The town modernized in the late 19th and early 20th centuries, as telegraph service was extended in August 1878 and shortly followed by a post office, while gas lighting came to the town in December 1910.
The town has seen its share of wars over the years. In September 1858, a major battle in the War of Reform, the Battle of Ahualulco, was fought in the town. Agricultural communities were devastated by the Mexican Revolution.
On July 1, 1932, the town changed its name to Ahualulco del Sonido 13, in honor of Julián Carrillo, a native of Ahualulco who developed said musical theory. The name was later changed back to just Ahualulco on May 25, 1944.