The evolution of C4 grassland ecosystems in eastern Africa has been intensely studied because of the potential influence of vegetation on mammalian evolution, including that of our own lineage, hominins. Although a handful of sparse vegetation records exists from middle and early Miocene terrestrial fossil sites, there is no comprehensive record of vegetation through the Neogene. Here we present a vegetation record spanning the Neogene and Quaternary Periods that documents the appearance and subsequent expansion of C4 grasslands in eastern Africa. Carbon isotope ratios from terrestrial plant wax biomarkers deposited in marine sediments indicate constant C3 vegetation from ∼24 Ma to 10 Ma, when C4 grasses first appeared. From this time forward, C4 vegetation increases monotonically to present, with a coherent signal between marine core sites located in the Somali Basin and the Red Sea. The response of mammalian herbivores to the appearance of C4 grasses at 10 Ma is immediate, as evidenced from existing records of mammalian diets from isotopic analyses of tooth enamel. The expansion of C4 vegetation in eastern Africa is broadly mirrored by increasing proportions of C4-based foods in hominin diets, beginning at 3.8 Ma in Australopithecus and, slightly later, Kenyanthropus. This continues into the late Pleistocene in Paranthropus, whereas Homo maintains a flexible diet. The biomarker vegetation record suggests the increase in open, C4 grassland ecosystems over the last 10 Ma may have operated as a selection pressure for traits and behaviors in Homo such as bipedalism, flexible diets, and complex social structure.