Pegomastax africanus is a newly classified dinosaur species and features a short, parrot-shaped beak, a pair of stabbing canines and tall teeth for slicing plants. (University of Chicago)

A tiny, plant-eating dinosaur with sharp fangs, a parrot-like beak and quills has been identified by a U.S. paleontologist.

Dubbed Pegomastax africanus, or "thick jaw from Africa," the newly classified species lived about 200 million years ago near the dawn of the dinosaur era. It is part of the Heterodontosaurus family.

The pint-sized dinosaur measured approximately 0.6 metres from head to tail and weighed less than a housecat.

Fossils of the bizarre creature were found in South Africa in the early 1960s, but remained largely ignored until they were examined by University of Chicago researcher Paul Sereno.

His study is published in the current issue of the journal ZooKeys.

"It would have looked a bit like a two-legged porcupine, covered in these weird, funky, quill-like things," Sereno told CBS in an interview.

The P. africanus had a blunt, parrot-shaped skull, less than eight centimetres long, which may have been adapted to picking fruit.

It also had tall teeth in its upper and lower jaws, which operated like self-sharpening scissors, and were used for slicing plants. Up front, it sported a pair of sharp, enlarged canine teeth resembling vampire fangs, a rare trait among herbivores.

Sereno says the teeth are similar to those of fanged deer and peccaries — modern-day, plant-eating mammals — and were likely used for self-defence and in competition for mates, rather than eating flesh.

"It would be a nice pet," Sereno told National Geographic, "if you could train it not to nip you."