Experts at nearly a dozen health institutions, including the Autonomous University of Barcelona, quizzed nearly 2,500 women on how often they had used paracetamol in the first 32 weeks of pregnancy.
The women were interviewed three months into their pregnancy and again at 32 weeks. Their children were then followed up until they were five years old.
The results revealed that children who were exposed to paracetamol in the womb were more likely to have autism symptoms or attention deficit hyperactivity disorder.
Both conditions are becoming more common, raising the question of whether medicines, pollution, food additives or other trappings of modern life are responsible.
The study found that boys and girls whose mothers were exposed at least once to paracetamol while pregnant were 40 per cent more likely to have ADHD symptoms.
And if their mothers regularly took the pills, they were twice as likely to have symptoms.
There was also a link with paracetamol and signs of autism - but only in boys.
When the researchers looked to see how many out of 31 symptoms of autism the children had, boys whose mothers took the pills throughout pregnancy tended to have two extra symptoms. Claudia Avella-Garcia, lead author of the Spanish study, said: "Although we measured symptoms and not diagnoses, an increase in the number of symptoms that a child has, can affect him or her, even if they are not severe enough to warrant a clinical diagnosis of a neurodevelopmental disorder."
Jordi Júlvez, a fellow researcher, said that paracetamol may affect the delicate development of the brain in the womb. Female sex hormones may protect against this, explaining why the autism link was only seen in the boys.
Writing in the International Journal of Epidemiology, Dr Júlvez said that more research was needed into the risks versus benefits of paracetamol in pregnancy before any new recommendations were made.
The drug safety watchdog, the Medicines and Healthcare products Regulatory Agency, said: "Women should avoid taking medicines during pregnancy unless absolutely necessary and should speak to their doctor, midwife or pharmacist before doing so.
"The findings of this study will be carefully evaluated to determine whether it has any implications for the safe use of paracetamol."
Professor Jean Golding, of Bristol University, said it was important to find out whether the drug was harming children's brains.
However, she cautioned that the study did not take into account other factors, such as smoking, that can affect the brain.
Dr James Cusack, of the charity Autistica, said the results were too preliminary to cause concern.
Professor Alan Cameron, of the Royal College of Obstetricians and Gynaecologists, said: "From these results we cannot determine a direct link between paracetamol usage and any neurodevelopmental problems.
"Future studies should take into account dosage as well as other possible contributory factors.
"Women should not be alarmed and we recommend that pregnant women continue to follow current guidance and take the lowest effective dose for the shortest possible time when necessary."