The axion is a hypothetical elementary particle postulated by the Peccei-Quinn theory to resolve the strong CP problem in QCD. If axions exist and have low mass, they are a candidate for dark matter as well. So far our knowledge of the properties of the QCD axion rests on semi-classical arguments and effective theory. In this work we perform, for the first time, a fully dynamical investigation of the Peccei-Quinn theory, focussing on the axion mass, by simulating the theory on the lattice. The results of the simulation are found to be in conflict with present axion phenomenology.