At high temperatures and relatively low CO2 concentrations, plants can most efficiently fix carbon to form carbohydrates through C4 photosynthesis rather than through the ancestral and more widespread C3 pathway. Because most C4 plants are grasses, studies of the origin of C4 are intimately tied to studies of the origin of the grasses. We present here a phylogeny of the grass family, based on nuclear and chloroplast genes, and calibrated with six fossils. We find that the earliest origins of C4 likely occurred about 32 million years ago (Ma) in the Oligocene, coinciding with a reduction in global CO2 levels. After the initial appearance of C4 species, photosynthetic pathway changed at least 15 more times; we estimate nine total origins of C4 from C3 ancestors, at least two changes of C4 subtype, and five reversals to C3. We find a cluster of C4 to C3 reversals in the Early Miocene correlating with a drop in global temperatures, and a subsequent cluster of C4 origins in the Mid-Miocene, correlating with the rise in temperature at the Mid-Miocene climatic optimum. In the process of dating the origins of C4, we were also able to provide estimated times for other major events in grass evolution. We find that the common ancestor of the grasses (the crown node) originated in the upper Cretaceous. The common ancestor of maize and rice lived at 52 ± 8 Ma.