Several prehistoric creatures developed elaborate body traits in order to attract members of the opposite sex, according to new research.
The purpose of the exaggerated crests and sails found in many fossil animals has long been controversial.
Some scientists said sails helped to regulate body temperature and that head crests helped flying reptiles steer during flight.
Now a study say these traits became so big because of sexual competition.
The findings, by an international team of researchers, is published in the journal American Naturalist.
One of the prehistoric animals looked at by the researchers were pterosaurs - flying reptiles which became extinct at the time of the dinosaurs.
The study suggests the relative size of the head crest compared to the body of the pterosaur was too large for it to have been dedicated to controlling the animal's body temperature or its flight.
They also looked at mammal-like creatures called Eupelycosaurs, which lived before the time of the dinosaurs.
This group, which included the animals Dimetrodon and Edaphosaurus, carried large elaborate "sails" along their backs.
By using known relationships between body size and metabolic activity - the process behind heat generation - in living organisms, the scientists concluded that the features were "too exaggerated" to have played a role in the control of body temperature.
Co-author Dr Stuart Humphries, from the University of Hull said: "One of the few things that haven't changed over the last 300 million years are the laws of physics.
"So it has been good to use those laws to understand what might really be driving the evolution of these big crests and sails."
His colleague, Dr Joseph Tompkins, from the University of Western Australia, commented: "The sails of the Eupelycosaurs are among the earliest known examples of exaggerated secondary sexual traits in the history of vertebrate evolution.
"Indeed, the sail of Dimetrodon is one of the largest secondary sexual traits of any animal."
Co-author Dr Dave Martill from the University of Portsmouth said: "Pterosaurs put even more effort into attracting a mate than peacocks whose large feathers are considered the most elaborate development of sexual selection in the modern day.
"Peacocks shed their fantastic plumage each year, so it's only a burden some of the time, but pterosaurs had to carry their crest around all the time."
Dr Tompkins added: "Our analysis suggests that male Pteranodon competed with each other in battles for dominance using their crests - in a similar way to animals with horns or antlers.
"Or alternatively, that females assessed males on the size of their crests, in a similar way to peahens choosing among a group of displaying males."
Dr Humphries said that collecting or dumping heat may well have been important in these animals.
But he said: "We have been able to show that these animals were likely to have been using their crests and sails mainly to attract mates or deter sexual competitors."