Anemia has been reported to adversely influence sleep in infants. However, the association between anemia in pregnancy and infant sleep remains unclear. We aimed to examine the association between maternal anemia in pregnancy and sleep parameters of 6-month-old infants. We enrolled 2,410 mother-infant pairs between 2018 and 2021 in Hefei. Data on maternal hemoglobin concentration were collected at 24-28 gestational weeks from the electronic medical records of the hospitals. Nocturnal and daytime sleep duration, number of night awakenings, nocturnal wakefulness, and sleep latency of infants aged 6 months were measured using the Brief Infant Sleep Questionnaire with five items. A restricted cubic spline model was used to examine the relationship between maternal hemoglobin concentration and infant nocturnal sleep duration after adjusting for potential confounders. In our study, 807 (33.5%) mothers had anemia during pregnancy. Compared to infants born to mothers without anemia, infants born to mothers with anemia in pregnancy had shorter nocturnal sleep duration [mean (SD), 560.29 (79.57) mins vs. 574.27 (75.36) mins] at the age of 6 months. Subgroup analysis showed consistent significant differences in nocturnal sleep duration between infant born to anemic and non-anemic mothers, except in case of stratification by preterm birth [mean difference (mins), 2.03 (95% CI, -20.01, -24.07)] and pre-pregnancy obesity [mean difference (mins), -0.85 (95% CI, -16.86, -15.16)]. A J-shaped nonlinear correlation curve was observed between maternal hemoglobin concentration and infant nocturnal sleep duration. Compared with mothers without daily iron supplementation, mothers who had daily iron supplementation had higher hemoglobin concentrations [mean (SD), 112.39 (11.33) g/L vs. 110.66 (10.65) g/L] at delivery and their infants had longer nocturnal sleep duration [mean (SD), 565.99 (82.46) mins vs. 553.66 (76.03) mins]. Anemia in pregnancy may have an adverse influence on the sleep of 6-mon-old infants, and the relationship between maternal hemoglobin concentration and nocturnal sleep duration is nonlinear.