Palaeontologists think they have found a way to tell whether dinosaur fossils are from males or females.
The finding strengthens the links between dinosaurs and birds
Writing in Science, a US team describe a specialised type of bone layer in fossils from a T. rex which is similar to one found in female birds.
In birds, the special tissue is called medullary bone and is laid down in the limbs of females when they lay eggs.
The bone tissue found in the dinosaur fossils most closely resembles the medullary bone of emus and ostriches.
The scientists behind the discovery say it reinforces the evolutionary links between dinosaurs and birds because it suggests their bodies went through similar processes during egg-laying.
"In addition to demonstrating gender, it also links the reproductive physiology of dinosaurs to birds very closely. It indicates that dinosaurs produced and shelled their eggs much more like modern birds than like modern crocodiles," said co-author Dr Mary Schweitzer, of North Carolina State University in Raleigh.
Some researchers have proposed that female dinosaurs differed from males in the shapes of their skeletons or in the forms of their head ornamentation. But these theories have been impossible to prove.
The medullary bone deposited by female birds when laying eggs is triggered by increasing levels of gonadal hormones produced on ovulation.
This tissue is rich in calcium and contains many small blood vessels, providing a ready source of calcium for eggs.
Medullary bone from a hen (red, above) and similar material in a T. rex fossil (below)
All the obvious indicators of a dinosaur's sex were thought to disappear as soft tissues decayed during fossilisation.
But Dr Schweitzer, Jack Horner and Jennifer Wittmeyer identified bone tissue in hind-limb fossils from a Tyrannosaurus rex that closely resembled the medullary bone of female birds.
The bone is most similar to that found in female members of a bird group called ratites, which includes ostriches and emus.
"If the medullary bone in T. rex is the same as seen in birds then we should expect it in dinosaurs between Tyrannosaurs and birds on the family tree," Darren Naish, a palaeontologist at the University of Portsmouth, UK, told the BBC News website.
"Then we should investigate whether it is present in other groups of dinosaurs."
Mr Naish speculated that the discovery could also be used as a tool to carry out investigations of the reproductive status of individual dinosaurs.