This prospective study examined 1) whether antenatal pain is associated with postnatal maternal bonding disorder (MBD) through postnatal depression and 2) whether intimate partner violence (IPV) has a moderating effect on the association between antenatal pain and postnatal MBD. We analyzed 77,326 pregnancies of women who completed self-report questionnaires including the SF-8 bodily pain item, the Edinburgh Postnatal Depression Scale, the Mother-to-Infant Bonding Scale, and an assessment of IPV. We conducted a mediation analysis to assess whether postnatal depression mediated the association between antenatal pain and MBD 1 year after delivery. A moderated mediation model was used to examine the conditional effect of IPV during pregnancy on the association between antenatal pain and postnatal MBD, operating through postnatal depression. All analyses were adjusted for demographic factors, socioeconomic factors, perinatal and infant factors, medical history, and psychological status. Of the 77,326 pregnancies, 5,420 (7.0%) were characterized by persistent moderate-to-severe pain. The total effect of antenatal pain on MBD was significant (standardized path coefficient = 0.06, 95% CI, 0.05–0.06) and postnatal depression dominantly mediated the association between antenatal pain and postnatal MBD (70.8% mediation). Contrary to our hypothesis, IPV during pregnancy did not moderate the association between antenatal pain and postnatal MBD. However, IPV during pregnancy did have independent negative effects on both postnatal depression and MBD. Our findings suggest that antenatal pain and postnatal depression should be assessed and treated with consideration of the presence of IPV during pregnancy to better monitor and prevent the development of MBD.