Researchers from the University of Edinburgh in UK conducted tests in rats and found that when a mother was given painkillers during pregnancy, her female offspring had fewer eggs, smaller ovaries and smaller litters of babies than those not exposed to the drugs.
Exposed male offspring were also found to be affected at birth - showing smaller numbers of cells that give rise to sperm in later life.
However, their reproductive function recovered to normal levels by the time they reached adulthood.
They tested the effects of two painkillers in pregnant rats - paracetamol and a prescription-only painkiller called indomethacin, which belongs to the same class of drugs as ibuprofen and aspirin.
Rats were given the drugs over the course of several days - four days for indomethacin or nine days for paracetamol. The effects of the drugs were seen within one to four days of the start of treatment.
In addition to affecting a mother's immediate offspring, the study showed that painkillers taken in pregnancy also affected the subsequent generation of rats.
The results suggest that some painkillers may affect the development of the cells that give rise to eggs and sperm - called germ cells - while a foetus is in the womb.
This may be because the painkillers act on hormones called prostaglandins. These are known to regulate female reproduction and control ovulation, the menstrual cycle and the induction of labour, researchers said.
"These studies involved the use of painkillers over a relatively long period. We now need to explore whether a shorter dose would have a similar effect, and how this information can be usefully translated to human use," said Richard Anderson from University of Edinburgh.
The findings were published in the journal Scientific Reports.
