Background: During pregnancy, many women experience sleep problems and anxiety that require treatment. The long-term safety for the child of maternal benzodiazepine (BZD) and z-hypnotic use during pregnancy remains controversial. Method We conducted a cohort and a sibling control study using data from the Norwegian Mother and Child Cohort Study. Data on use of BZD and z-hypnotics, internalizing and externalizing outcomes, and covariates were collected from mothers at gestational weeks 17 and 30 and when children were 0.5, 1.5, and 3 years of age. The total sample consisted of 71,996 children (19,297 siblings) at 1.5 years and 55,081 children (13,779 siblings) at 3 years. Short-term use was defined as use in one pregnancy period only. Long-term use was defined as use in two or more pregnancy periods. Linear full cohort random-effect and sibling-matched fixed-effect regression models were used to compare internalizing and externalizing behavior in children prenatally exposed compared to those unexposed in the full cohort of pregnancies accounting for family clusters, as well as within sibling clusters comparing pregnancies with discordant exposures. Propensity score (PS) adjustment included variables on indication for use (sleep problems, symptoms of anxiety and depression) and other potential confounding factors. Results: Long-term prenatal exposure to BZD or z-hypnotics was associated with increased internalizing behavior in crude cohort analyses and at age 1.5 years after PS adjustment in sibling-matched fixed-effect models [β 0.60, 95% confidence interval 0.17–0.95]. Analyses on specific drug groups showed that prenatal exposure to BZD-anxiolytics was associated with increased internalizing problems at both 1.5 years [β 0.25, 0.01–0.49] and 3 years [β 0.26, 0.002–0.52] while exposure to z-hypnotics was not associated with any adverse outcomes after adjustment. Conclusion: The findings suggest a moderate association between BZD-anxiolytic exposure and child internalizing problems that is not likely due to stable familial confounding factors