When researchers connected birth details to public health records, they found that 3658 of the women had earlier suffered Chlamydia and 196 had gonorrhea.
Nearly 4.1 per cent of women had experienced an unplanned premature birth and 0.6 per cent had suffered a stillbirth.
The researchers discovered that women who were earlier infected with Chlamydia or gonorrhea carried an elevated risk of premature or stillbirth even after taking into account other risk factors.
The risk of suffering a stillbirth was 42% among women infected with Chlamydia compared to women without the infection.
Those infected with gonorrhea were more than twice as likely to suffer a stillbirth or unplanned premature birth.
"This really underlines the importance of the safe sex message to prevent STIs. People might think they only have immediate effects but potentially there are more serious consequences," researchers said.