The University of Cambridge researchers say their findings from more than 300 boys help unravel the causes of autism – a condition that affects both sexes but is far more common in males.
But they say it does not mean a prenatal test for autism is near.
Nor will it necessarily be possible to stop autism by blocking the hormones.
The hormones in question – testosterone and three other steroid hormones – were important for foetal development, which meant it could be too risky to block them, they told the journal Molecular Psychiatry.
But the findings did pinpoint an important window in foetal development when autism might be triggered, they said.
The study authors, Dr Michael Lombardo and Prof Simon Baron-Cohen, looked at stored samples of amniotic fluid – the liquid that surrounds a baby while in the womb – to see if there was anything about this early environment that might explain autism risk.
They found that for 128 boys who later went on to develop autism, levels of steroid hormone in the amniotic fluid that had bathed them as a baby in the womb were, on average, particularly high.
In comparison, far lower levels of steroid hormone were detected in the corresponding amniotic fluid of a control group of 217 boys without autism.
Prof Baron-Cohen said: “This is one of the earliest non-genetic biomarkers that has been identified in children who go on to develop autism.
“We previously knew that elevated prenatal testosterone is associated with slower social and language development, better attention to detail, and more autistic traits. Now, for the first time, we have also shown that these steroid hormones are elevated in children clinically diagnosed with autism.
“Because some of these hormones are produced in much higher quantities in males than in females, this may help us explain why autism is more common in males.”
The study did include some girls, but the researchers say they need to do more investigating to see if a similar association between sex hormones and autism might exist in females.
Steroid hormones influence how instructions in our genetic code – DNA – are translated into making important proteins.
The researchers believe that altering this process in early life when the building blocks for the brain are being laid down may explain how genetic risk factors for autism get expressed or “switched on”.
The exact causes of autism are unknown, although it is thought that genes and environmental factors are involved.
The developmental disorder usually starts to develop in childhood and can cause problems with social interaction, language skills and behaviour.
Prof Richard Sharpe, an expert at the University of Edinburgh, said the work was “an important first step” on the path to discovering what causes autism.
Richard Mills, of Research Autism said: “Despite a growing awareness of the biological and genetic nature of autism, there is currently no agreed biological or genetic marker for autism, with diagnosis made on the basis of early developmental history and behavioural criteria.
“So research that sheds light on this specific area is critical to our understanding of this mysterious and highly complex group of conditions.”