One of the world's smallest ever dinosaur skulls has been discovered and scientists believe it may fill a gap in their knowledge about why some of the creatures turned vegetarian.
The skull, less than two inches long, belonged to a baby Heterodontosaurus which lived 190 million years ago and was just six inches tall and 18 inches from head to tail.
But it was not so much its size that intrigued scientists as its teeth. Experts have been divided over whether Heterodontosaurus ate meat or plants.
The mini-dinosaur, which weighed about the same as a mobile phone, has long fang-like teeth at the front of its jaw and grinding teeth typical of herbivores at the back, suggesting it was equipped for both.
It has been argued that the fangs may have been confined to adult males - like the tusks of warthogs - and used for fighting over mates or territory.
But this theory has now been overturned by the baby skull, which has fully formed fangs.
Their presence at such a young age indicates they had a different purpose, most likely to defend against predators or hunt prey.
The scientists who made the discovery now believe Heterodontosaurus was in the process of evolutionary transition from carnivore to vegetarian.
It was probably an omnivore, living mainly on plants and supplementing its diet with insects, small mammals or reptiles.
Laura Porro, a Phd student from the University of Chicago in the US, said: "It's likely that all dinosaurs evolved from carnivorous ancestors.
"Since Heterodontosaurs are among the earliest dinosaurs adapted to eating plants, they may represent a transition phase between meat-eating ancestors and more sophisticated, fully herbivorous descendants.
"This juvenile skull indicates that these dinosaurs were still in the midst of that transition."
Heterodontosaurus fossils are extremely rare and until now only two were known, both found in South Africa and belonging to adults.
Ms Porro found the partial baby skull fossil, together with two more adult fossils, in a collection at the Iziko South African Museum in Cape Town dating back to excavations in the 1960s.
"I didn't recognise it as a dinosaur at first," she said. "But when I turned it over and saw the eye looking straight at me, I knew exactly what it was."
Dr Richard Butler, from the Natural History Museum in London, one of the authors who described the find in the Journal of Vertebrate Palaeontology, said: "This discovery is important because for the first time we can examine how Heterodontosaurus changed as it grew.
"The juvenile dinosaurs of this type had relatively large eyes and a short snout when compared to an adult - similar to the differences we see between puppies and fully grown dogs."
Adult Heterodontosaurs, which lived during the Early Jurassic period in South Africa, were about the size of a turkey and weighed around five to six pounds.
Another peculiarity about Heterodontosaur teeth came to light when the scientists carried out X-ray scans of both juvenile and adult skulls.
Most reptiles, including living crocodiles and lizards, replace their teeth constantly throughout their lives. There is evidence that this was also true for dinosaurs.
But Heterodontosaurus appeared to have been more similar to mammals, which grow specialised teeth that are replaced slowly if at all.
The researchers wrote: "Tooth replacement must have occurred during growth, however evidence of continuous tooth replacement appears to be absent, in both adult and juvenile specimens."