© Getty Illustration picture shows a doctor doing an ultrasound examination during a visit of a pregnant woman to her gynaecologist, in Mechelen, Thursday 31 January 2019. BELGA PHOTO JASPER JACOBS (Photo credit should read JASPER JACOBS/AFP/Getty Images)

Taking some common antibiotics during the first trimester of pregnancy was linked with higher risk of birth defects, according to a new study.

The study, published Wednesday in the medical journal BMJ, found an increased risk of birth defects in the children of women who were prescribed macrolides during the first three months of pregnancy compared to mothers who were prescribed penicillin.

Macrolide antibiotics include erythromycin, clarithromycin and azithromycin, and they are used to treat infections, such as pneumonia, bronchitis and urinary, skin and sexually transmitted diseases. They are often prescribed for patients who are allergic to penicillin. According to the study, macrolides are one of the most frequently prescribed antibiotics in Western countries.

The study analyzed data from 104,605 children born in the United Kingdom between 1990 and 2016 and who were born to mothers prescribed either penicillin or macrolides. Researchers looked for birth defects and neurodevelopmental disorders diagnosed later in life.

The study found that prescribing macrolides to pregnant women during the first trimester increased the risk of major malformations to 28 of 1,000 births, compared 18 per 1,000 births with penicillin. Specifically, the risk of cardiac malformations was higher.

The study did not find a link between macrolides prescription and neurodevelopmental disorders. There was also no associated risk between birth defects and macrolides prescribed before conception.

University College London Professor Ruth Gilbert, one of the authors of the study, said this is a small but still significant increase and, based on these findings, pregnant women and their doctors should find an alternative depending on the type of infection.

Gilbert also warned about the risks of not taking antibiotics at all.

"If you've got a bacterial infection, it's really important to take antibiotics because infection itself can be really damaging to the unborn baby," Gilbert said.

The study is based on a series of analyses of a broad health database of general practitioners in the UK. Gilbert said an even larger data set could provide insight on less common birth defects and other outcomes from taking certain antibiotics.

In 2005, Sweden warned against the use of the macrolide erythromycin during the first trimester of pregnancy after a report found a link between the medicine and heart defects, the study said. Currently, regulatory authorities in the United States and the UK only warn against the use of azithromycin and clarithromycin for adults with a high risk of cardiovascular complications, according to study authors.

A previous study published in the Canadian Medical Association Journal found common antibiotics, including macrolides, are linked to an increased risk of miscarriage when used in early pregnancy.

Related video: What to do when food is recalled