Scientists have uncovered the first evidence of live births in the group of animals that includes dinosaurs, crocodiles and birds.
All examples of this group, known as the Archosauromorpha, lay eggs.
This led some scientists to wonder whether there was something in their biology that prevented live births.
But examination of the fossil remains of a very long-necked, 245 million-year-old marine reptile from China revealed it was carrying an embryo.
Jun Liu, first author of the new study, told BBC News that the animal would have measured between three and four metres long, with a neck that was about 1.7m long.
The embryo may have been around half a metre long and is positioned inside the rib cage of the adult Dinocephalosaurus fossil, which was discovered in 2008.
Researchers had to consider whether the smaller animal might have been part of the adult’s last meal. But it’s facing forward, whereas swallowed prey generally face backwards because predators usually consume the animal head first to help it go down its throat.
Another line of evidence in favour of the live birth idea is that the small reptile inside the mother is clearly an example of the same species.
Prof Liu, from Hefei University of Technology in China, said the discovery pushes back evidence of reproductive biology in the archosauromorphs by 50 million years.
The mode of reproduction in Dinocephalosaurus also points to how the sex of its offspring was determined.
Co-author Prof Chris Organ, from Montana State University, added: “Some reptiles today, such as crocodiles, determine the sex of their offspring by the temperature inside the nest.
“We identified that Dinocephalosaurus, a distant ancestor of crocodiles, determined the sex of its babies genetically, like mammals and birds.”
The researchers surmise that giving birth to live young must have been a crucial factor in allowing Dinocephalosaurus to evolve a fully aquatic lifestyle.
The team says its long neck and other features of its anatomy suggest it could not have manoeuvred easily out of the water, meaning a reproductive strategy like that of turtles – which lay eggs on land before returning to the water – was probably not an option.