Background Increased weight gain during infancy is a risk factor for obesity and related diseases in later life. The aim of the present study was to investigate the association between socioeconomic status (SES) and weight gain during infancy, and to identify the factors mediating the association between SES and infant weight gain. Methods Subjects were 2513 parent-child dyads participating in a cluster randomized controlled intervention study. Family SES was indexed by maternal education level. Weight gain in different time windows (infant age 0–3, 0–6, and 6–12 months) was calculated by subtracting the weight for age z-score (WAZ) between the two time-points. Path analysis was performed to examine the mediating pathways linking SES and infant weight gain. Results On average, infants of low-educated mothers had a lower birth weight and caught-up at approximately 6 months. In the period of 0–6 months, infants with low-educated mothers had an 0.42 (95% CI 0.27–0.57) higher gain in weight for age z-score compared to children with high-educated mothers. The association between maternal education level and increased infant weight gain in the period of 0–6 months can be explained by infant birth weight, gestational age at child birth, duration of breastfeeding, and age at introduction of complementary foods. After adjusting all the mediating factors, there was no association between maternal education level and infant weight gain. Conclusion Infants with lower SES had an increased weight gain during the first 6 months of infancy, and the effect can be explained by infant birth weight, gestational age at child birth, and infant feeding practices.