A small, two-legged dinosaur that browsed leaves and berries in the forests of the late Cretaceous fought off rivals by unleashing some of the most formidable head butts ever seen, say scientists.

Stegoceras validum, a beast no bigger than a goat, was engaging in head-to-head combat to overpower its sexual competitors 72m years ago in what is now North America.

Brain scans of skulls belonging to Stegoceras and modern animals that practise head-ramming, such as bighorn sheep and musk ox, revealed that they share cranial features that allowed the animals to withstand eye-watering clashes.

The bony anatomy of the Stegoceras head would have been particularly effective at absorbing heavy blows, and better able to protect the animal's brain than that of any living creature that embraces head-butting as a mate-winning strategy.

"The Stegoceras skull is almost like an enhanced motorcycle helmet. It has a stiff outer shell and a compliant layer beneath, and then another really stiff layer over the brain," said Eric Snively a co-author on the study at Ohio University.

X-ray scans of the skulls of giraffes and llamas, which don't engage in cranial combat, suggested the animals would sustain life-threatening injuries to their heads if they tried, according to the report in the journal PLoS One.

Snively and Jessica Theodor at the University of Calgary in Alberta used a hospital CT (computed tomography) scanner and collision simulation software to investigate the controversial role of the thick, bony domes that characterise pachycephalosaurs such as Stegoceras. An alternative theory has it that the domes were purely for sexual display, like a peacock's tail.

The scans showed that both Stegoceras and modern head-butting animals have relatively large neck muscles and a dense dome of cortical bone above a spongier layer of cancellous bone. The living animal whose skull most closely ressembled Stegoceras was the common duiker, a small antelope that is native to sub-Saharan Africa.

Using a technique called finite element analysis, Snively and Theodor modelled the stresses and strains on the animals' skulls during virtual head-on-head collisions, which allowed them to calculate the violence they could survive. The Stegoceras used in the study had a bony dome some 9cm thick, though some relatives boasted skulls more than 20cm thick.

"It is clear that although the bones are arranged differently in the Stegoceras, it could easily withstand the kinds of forces that have been measured for the living animals that engage in head-butting," Theodor said.