Maternal depression increases child vulnerability to psychopathology, loneliness, and social maladjustment; yet, its long-term effects on the social brain are unknown. In this prospective longitudinal study we examined the impact of early and persistent maternal depression on the neural basis of attachment in preadolescence. A community cohort was followed in two groups; children exposed to maternal depression from birth to 6 years and healthy controls. At 9 months and 6 years, mother-child interactions were coded for maternal sensitivity and affect synchrony and salivary oxytocin levels were assessed at 6 years. At preadolescence (11-13 years), children underwent magnetoencephalography (MEG) while exposed to own versus unfamiliar mother-child interaction. Own interaction elicited greater response in beta- and gamma-band oscillations across a wide cluster in temporal and insular cortices, including the Superior Temporal Sulcus, Superior Temporal Gyrus, Inferior Temporal Gyrus, and insula. Beta activations were predicted by maternal sensitivity across early childhood and gamma by affect synchrony. Oxytocin was related to beta response to social cues. Maternal depression impacted child's brain response in two ways. First, maternal depression significantly increased the prevalence of child affective disorder and such children showed no neural differentiation between attachment and non-attachment stimuli. Second, maternal depression decreased maternal sensitivity, affect synchrony, and child oxytocin across early childhood and these were longitudinally associated with aberrant neural response to attachment-specific and social-general cues in preadolescence. Our findings are the first to describe mechanisms by which maternal depression impairs the neural basis of attachment at the transition to adolescence and advocate the need for relationship-focused early interventions.