Background: Recent data suggest an increased risk of congenital anomalies with prenatal exposure to opioid analgesics. We sought to further quantify the risk of anomalies after opioid analgesic exposure during the first trimester in a population-based cohort study. Methods: Using administrative health data from Ontario, we followed 599 579 gestational parent-infant pairs from singleton pregnancies without opioid use disorder. We identified opioid analgesics dispensed in the first trimester and congenital anomalies diagnosed during the first year of life. We estimated propensity score-adjusted risk ratios (RRs) between first trimester exposure (any opioid analgesic and specific agents) and congenital anomalies (any anomaly, organ system anomalies, major or minor anomalies and specific anomalies). Results: The prevalence of congenital anomalies was 2.8% in exposed infants and 2.0% in unexposed infants. Relative to unexposed infants, we observed elevated risks among those who were exposed for some anomaly groups, including gastrointestinal anomalies (any opioid analgesic: adjusted RR 1.46, 95% confidence interval [CI] 1.15-1.85; codeine: adjusted RR 1.53, 95% CI 1.12-2.09; tramadol: adjusted RR 2.69, 95% CI 1.34-5.38) and several specific anomalies, including ankyloglossia (any opioid: adjusted RR 1.88, 95% CI 1.30-2.72; codeine: adjusted RR 2.14, 95% CI 1.35-3.40). These findings persisted in sensitivity analyses. Interpretation: Although the absolute risk of congenital anomalies was low, our findings add to accumulating data that suggest a small increased risk of some organ system anomalies and specific anomalies with first trimester exposure to opioid analgesics. These findings further quantify the potential risks associated with prenatal exposure to opioid analgesics to inform treatment choices for pain in pregnancy.