A blood sample from mum and saliva from dad have been used to sequence the genome of a foetus in the womb, by US researchers.
At the time, the mother was just 18 weeks into the pregnancy.
The doctors said the findings, reported in Science Translational Medicine , could eventually lead to foetuses being screened for thousands of genetic disorders in a single and safe test.
However, they also caution it would raise "many ethical questions".
The scientists at the University of Washington used pieces of the foetus' DNA which naturally float around in the pregnant woman's blood.
These fragments were then pieced together using the parents' DNA as a guide to build a complete 'map' of the foetus's genome.
They then compared the genetic map drawn 18 weeks into pregnancy with the foetus' actual DNA taken from the umbilical cord after birth. It was 98% accurate.
The researchers hope their findings will one day be used to test safely for genetic diseases.
Tests do already exist such as those for Down's syndrome. To test for Down's syndrome a sample is taken from the sac around the developing foetus, which comes with a risk of miscarriage.
They also say new genetic defects, which are not present in the parents, could be picked up if the technique could be improved. Such mutations form in the eggs, sperm or at conception.
There were 44 new mutations in the foetus and the screen at 18 weeks found 39 of them. However, the screening also detected 25 million possible new mutations or false positives.
One of the researchers, Dr Jay Shendure, said: "This work opens up the possibility that we will be able to scan the whole genome of the foetus for more than 3,000 single-gene disorders through a single, non-invasive test."
Professor of molecular medicine at the University of Leeds, David Bonthron, told the BBC: "It's interesting, very clever and also technically very challenging."
He said genetics was advancing at an incredible pace, but cautioned: "I can't envisage clinical use anywhere really for several years at least."
He said such tests would raise the question: "What are you going to do with the information?
"That's a societal question, it's a question about what society thinks is acceptable."
Josephine Quintavalle, from the Pro-life Alliance, said: "Information itself may be neutral but genetic testing in utero currently almost inevitably leads to abortion of the unborn child.
"The easier and more comprehensive the test the more likely it is that such abortions will increase."