Taking the tablets for just two to seven days within the first three months could lead to a short period of fertility, early menopause or infertility in the girls that grow up.
And even if women stop taking the painkiller, the damage is irreversible.
The study suggested the non-steroidal anti-inflammatory drug taken in the first 24 weeks of pregnancy may reduce the store of eggs in the ovaries of their daughters.
The study was the first evidence in human ovarian tissue that ibuprofen exposure during the crucial first trimester of foetal development resulted in a “dramatic loss” of the germ cells.
These go into making the follicles from which female eggs develop and either died or failed to grow and multiply at the usual rate following exposure in the womb.
Scientists said the findings raised concerns about the long-term effects of ibuprofen on the future fertility of these unborn women.
Lead author Dr Séverine Mazaud-Guittot at INSERM in Rennes said: “Baby girls are born with a finite number of follicles in their ovaries and this defines their future reproductive capacity as adults
“A poorly stocked initial reserve will result in a shortened reproductive life span, early menopause or infertility - all events that occur decades later in life.
“The development of the follicles in the foetus has not been completed by the end of the first trimester, so if the ibuprofen treatment is short then we can expect the ovarian reserve to recover to some extent.
“However, we found that two to seven days of exposure to ibuprofen dramatically reduced the germ cell stockpile in human foetal ovaries during the first trimester of pregnancy and the ovaries did not recover fully from this damage.
“This suggests that prolonged exposure to ibuprofen during foetal life may lead to long-term effects on women’s fertility and raises concern about ibuprofen consumption by women during the first 24 weeks of pregnancy.
“These findings deserve to be considered in light of the present recommendations about ibuprofen consumption during pregnancy.”
It is estimated three in ten women take the painkiller in the first three months of pregnancy.
Currently women are advised not to take it after that time as it is known to increase the risks of foetal malformations but there are no firm guidance on whether or not it is safe to take in the early weeks.
The NHS advises pregnant women not to take ibuprofen unless a doctor prescribes it and they should use paracetamol instead.
The study which involved researchers from the universities of Edinburgh and Copenhagen involved used aborted human foetuses aged between seven to 12 weeks
Then they cultured the ovarian tissue in the laboratory and exposed part of the tissue to ibuprofen while a second part was not.
Samples from 185 foetuses were analysed.
Researchers also measured the quantity of ibuprofen in the blood in the umbilical cord to analyse how much the foetus would have been exposed to in women undergoing termination.
They found ibuprofen crossed the placental barrier.
Dr Mazaud-Guittot added: “The concentration that we found in the umbilical cords of foetuses from mothers who ingested 800 mg (four pills of 200 mg) two to four hours before surgery is similar to the concentration that can be found in adult’s blood for the same treatment.
“In simple terms, the foetus is exposed to the same concentration as the mother.
“Therefore, we tested concentrations that were in the range of those that can be found in adult’s blood in the ovarian samples in the lab.”
They found tissue exposed to concentrations of 10 μM (micromolar) of ibuprofen for a week had approximately half the number of ovarian germ cells.
Dr Mazaud-Guittot explained: “We found there were fewer cells growing and dividing, more cells dying and a dramatic loss of germ cell numbers, regardless of the gestational age of the foetus
“There were significant effects after seven days of exposure to 10 μM of ibuprofen, and we saw cell death as early as after two days of treatment.
“Five days after withdrawing ibuprofen, these harmful effects of ibuprofen were not fully reversed.
“This is the first study to look at the effects of ibuprofen on the ovarian tissue of baby girls, and the first to show that ibuprofen can cross the placental barrier during the first trimester of pregnancy, exposing the foetus to the drug.
“The implications of our findings are that, just as with any drug, ibuprofen use should be restricted to the shortest duration and at the lowest dose necessary to achieve pain or fever relief, especially during pregnancy.
“The wisest advice would be to follow currently accepted recommendations: paracetamol should be preferred to any anti-inflammatory drug up to 24 gestational weeks, and the latter should not be used thereafter.
“However, practitioners, midwifes and obstetricians are best placed to give expert advice: every mother and every pregnancy is unique.”
Future research will look into the mechanisms of action of ibuprofen on human ovaries, and on alternative painkillers.
Professor Hans Evers, editor-in-chief of the journal Human Reproduction, commented: “The authors are to be commended for investigating the effect of ibuprofen on germ cells and follicles in human ovarian tissue, and these are important findings that require further investigation.
“However, at this stage it is not possible to say whether the reduced numbers of follicles in tissue samples from baby girls might translate into reduced fertility 30 years later.
“At present this is speculation and requires long-term follow-up studies of daughters of women who took ibuprofen while in their first three months of pregnancy.”