Within the cereal grasses, variation in inflorescence architecture results in a conspicuous morphological diversity that in crop species influences the yield of cereal grains. Although significant progress has been made in identifying some of the genes underlying this variation in maize and rice, in the temperate cereals, a group that includes wheat, barley, and rye, only the dosage-dependent and highly pleiotropic Q locus in hexaploid wheat has been molecularly characterized. Here we show that the characteristic variation in the density of grains along the inflorescence, or spike, of modern cultivated barley (Hordeum vulgare) is largely the consequence of a perturbed interaction between microRNA172 and its corresponding binding site in the mRNA of an APELATA2 (AP2)-like transcription factor, HvAP2. We used genome-wide association and biparental mapping to identify HvAP2. By comparing inflorescence development and HvAP2 transcript abundance in an extreme dense-spike mutant and its nearly isogenic WT line, we show that HvAP2 turnover driven by microRNA 172 regulates the length of a critical developmental window that is required for elongation of the inflorescence internodes. Our data indicate that this heterochronic change, an altered timing of developmental events caused by specific temporal variation in the efficiency of HvAP2 turnover, leads to the striking differences in the size and shape of the barley spike.