(CNN) - A common antibiotic has been linked to a higher risk of birth defects, according to a new study.
The study, published in the medical journal BMJ, suggests women who were prescribed macrolides during the first three months of pregnancy had an increased risk of birth defects compared to those who were prescribed penicillin.
They're used to treat infections and most often prescribed when a patient is allergic to penicillin.
The findings were that prescribing macrolides, which include erythromycin, clarithromycin and azithromycin, to pregnant women increased the risk of major malformations to 28 per 1,000 births compared to 18 per 1,000 births with penicillin.
Specifically, the risk of cardiac malformations was higher.
The study analyzed data from more than 104,600 children born in the U.K. between 1990 and 2016.
Their mothers were either prescribed penicillin or macrolides.
The study did not find a link between macrolides and neurodevelopmental disorders and there was also no associated risk between birth defects and macrolides prescribed before conception.
An author of the study says based on the findings, pregnant women and their doctors should find an alternative antibiotic depending on the type of infection.
A study author also cautions about risks of not taking antibiotics at all, saying infection itself can be very damaging to the unborn baby as well.