UK scientists say they have solved the mystery of why prehistoric flying reptiles grew crests on their heads.
The specimen belonged to the species Tupuxuara
A rare skull specimen found in Brazil shows the crest appeared at puberty, suggesting it was used to attract attention from the opposite sex.
University of Portsmouth experts say pterosaurs, which ruled the air during the time of the dinosaurs, flaunted their headgear in sexual displays.
The findings are published in the journal Palaeontology.
Palaeobiologist Dr Darren Naish said the crest was a signal of sexual maturity; it was used like a peacock's tail to attract a mate.
"It would have been like a gigantic cockerel's comb, a brightly coloured, striking structure used in display," he told the BBC News website.
"We don't know this but we imagine they would have bobbed it around and used it to attract other pterosaurs."
The theory is based on the juvenile skull of a Tupuxuara pterosaur, which was unearthed recently in north-east Brazil.
It was a rare discovery; only a handful of fossil specimens exist in the world and all the others are the remains of adults.
Pterosaurs lived during the Jurassic and Cretaceous Periods
They were the first actively flying vertebrates and evolved many different forms
Pterosaurs are thought to belong to a group of reptiles known as archosaurs, which includes crocodiles, dinosaurs and birds
Dr Naish and colleague Dr David Martill examined the skull and found that the crest was different in the juvenile.
Rather than forming one large triangular crest of bone extending from the snout to the back of the head, it was made up of two pieces.
One crest came from the back of the skull and the other from the front of the snout. The crest that sprouted from the front grew backwards, only fusing to form one large crest when the pterosaur reached puberty.
"This is a significant find as it links the growth of the crest to physical maturity and therefore presumably to sex," said Dr Naish.
"The specimen was extremely rare and it is great to be able to piece together a little bit more details about pterosaurs."