ObjectivesHigh maternal pre‐pregnancy body mass index (BMI), high birth weight, and rapid infant weight gain are associated with increased risk of childhood obesity. We examined whether moderate‐to‐vigorous physical activity (MVPA) or vigorous physical activity (VPA) in 9‐ to 12‐year‐olds modified the associations between these early life risk factors and subsequent body composition and BMI.MethodsWe used data from a sub‐cohort of the Norwegian Mother and Child Cohort Study (MoBa), including 445 children with available data on accelerometer assessed physical activity (PA). All participants had data on BMI, 186 of them provided data on body composition (dual energy X‐ray absorptiometry (DXA)). We used multiple regression analyses to examine the modifying effect of PA by including interaction terms.ResultsMaternal pre‐pregnancy BMI and infant weight gain were more strongly related to childhood body composition in boys than in girls. Higher VPA attenuated the association between maternal pre‐pregnancy BMI and BMI in boys (low VPA: B = 0.32, 95% CI = 0.22, 0.41; high VPA B = 0.22, 95% CI = 0.12, 0.31). Birth weight was unrelated to childhood body composition, and there was no effect modification by PA. PA attenuated the associations between infant weight gain and childhood fat mass (low MVPA: B = 2.32, 95% CI = 0.48, 4.17; high MVPA: B = 1.00, 95% CI = 0.10, 1.90) and percent fat (low MVPA: B = 3.35, 95% CI = 0.56, 6.14; high MVPA: B = 1.41, 95% CI = −0.06, 2.87) in boys, but not girls.ConclusionFindings from this study suggest that MVPA and VPA may attenuate the increased risk of an unfavorable body composition and BMI due to high maternal pre‐pregnancy BMI and rapid infant weight gain in boys, but not in girls.