The explosion took place in a courtyard near the Army's explosives fuse factory as a chemical container was exposed to sunlight, Moo 2 village headman Manoch Chanket said.
"The chemical container was placed outdoors, as the factory is currently under renovation," he said.
He said no one was injured, and the situation was currently under control.
Meanwhile Sali Sapmak, a 42-year-old mahout who witnessed the incident, said he heard an explosion three times and saw thick white smoke.
He added that his elephant panicked after hearing the explosion.
Ayutthaya Governor Niwat Rungsakorn rushed to the scene to investigate the incident.
Related stories:
Tennis player wanted over fatal road accident quits Thai national team