Image caption It was the males which carried a crest, the latest research published in Science magazine suggests

For fossil hunters, it represents one of those breakthrough moments.

A pterosaur has been found in China beautifully preserved with an egg.

The egg indicates this ancient flying reptile was a female, and that realisation has allowed researchers to sex these creatures for the first time.

Writing in Science magazine, the palaeontologists make some broad statements about differences in pterosaurs, including the observation that only males sported a head-crest.

David Unwin, a palaeobiologist in the Department of Museum Studies at the University of Leicester, was part of the research team.

He told the BBC the discovery was astonishing: "If somebody had said to me a few years back that we would find this kind of association, I would just have laughed and said, 'yeah, maybe in a million years', because these sorts of things are incredibly rare."

Pterosaurs, also sometimes referred to as pterodactyls, dominated the skies in the Mesozoic Era, 220-65 million years ago. Although reptiles like the dinosaurs were plodding on the ground below them, they were not actually dinosaurs themselves - a common misconception.

This particular specimen has been dated to about 160 million years ago.

It was found by Junchang Lü and colleagues and excavated from sedimentary rocks in the famous fossil-hunting grounds of Liaoning Province in China. Liaoning has yielded many of the great finds in recent years, including a series of feathered dinos that have transformed thinking on bird evolution.

The new creature is from the Darwinopterus genus, or grouping, but has been dubbed simply as "Mrs T" (a contraction of "Mrs Pterodactyl") by the research team.

The state of the egg's shell suggests it was well developed and that Mrs T must have been very close to laying it when she died.

She appears to have had some sort of accident as her left forearm is broken. The researchers speculate she may have fallen from the sky during a storm or perhaps a volcanic eruption, sunk to the bottom of a lake and then been preserved in the sediments.

"The most important thing about this particular individual is that she has a relatively large pelvis compared to other individuals of the same pterosaur, Darwinopterus," explained Dr Unwin.

"This seems quite reasonable - females lay eggs, they probably need a slightly wider pelvis. And then the really exciting thing is that she has a skull which lacks any kind of adornment or decoration whatsoever. When we look at other individuals of Darwinopterus, we find quite a few individuals with a large crest on the skull.

"We're very confident now that we're dealing with two genders here - males with big crests and small hips, and females with no crest on the skull and large hips."

Image caption The female fossil partially prepared (A). After being fully prepared (B), the egg is clear to see (red circle)

Jonathan.Amos-INTERNET@bbc.co.uk