A study of fossil dinosaur dung has for the first time confirmed that the ancient reptiles ate grass.
Dinosaurs seem to have been indiscriminate eaters
Grass was previously thought to have become common only after the dinosaurs died out 65 million years ago.
But grasses were probably not a very important part of dinosaur diets - the fossilised faeces show the big beasts ate many different types of plants.
However, the Science journal study suggests grass was possibly an important food for early mammals.
Caroline Strömberg from the Swedish Museum of Natural History and her colleagues studied phytoliths (mineral particles produced by grass and other plants) preserved in fossil dinosaur dung from central India.
The 65-67 million-year-old dung fossils, or coprolites, are thought to have been made by so-called titanosaur sauropods; large, vegetarian dinosaurs.
"It's difficult to tell how widespread [grass grazing] was," Ms Strömberg told the BBC News website, "Dinosaurs seem to have been indiscriminate feeders."
Fossil grass phytoliths were found in the dinosaur dung
The study also sheds new light on the evolution of grass. Grasses are thought to have undergone a major diversification and geographic proliferation during the so-called Cenozoic, after the dinosaurs had gone extinct.
But the researchers found at least five different types of grass in the droppings.
This suggests grasses had already undergone substantial diversification in the Late Cretaceous, when the giant beasts still walked the Earth.
Many grasses today contain high levels of silica, which makes them tough and hard to chew. One theory proposes that this is an evolutionary defence against being eaten by herbivores.
This defence is traditionally thought to have been a response to large-scale grazing by mammals in the Cenozoic. But, if the theory is correct, it raises the possibility that grasses first began developing this defence in response to grazing by dinosaurs.
However, small mammals living alongside the dinosaurs may also have been grass feeders.
An enigmatic group of extinct mammals known as sudamericid gondwanatherians, which lived during the Late Cretaceous, show possible signs of adaptation to a grassy diet.
Their teeth are ideally suited for handling abrasive materials like grass. But because of grass's patchy presence in the fossil record, these features were interpreted as an adaptation to a semi-aquatic, or burrowing, lifestyle like that of modern beavers.