This study aimed to examine the independent roles of various childhood maltreatment (CM) subtypes in the development of depression; quantify the joint mediation effect of social support and mastery in the association between subtypes of CM and depression and examine the additional contribution of mastery beyond the effect that is operating through social support to this relationship. Data analysed were from the Zone d'Épidémiologie Psychiatrique du Sud-Ouest de Montréal, an ongoing longitudinal population-based study. In total, 1351 participants with complete information on the studied variables were included. The propensity score matching and inverse-probability weighted regression adjustment estimation methods were used to minimise the potential confounding in the relationship between CM and major depression. We then used inverse odds ratio-weighted estimation to estimate the direct effects of maltreatment and indirect effects of social support and mastery. We found that exposures to all maltreatment subtypes increased the risk of subsequent depression. The joint mediating effect of social support and mastery explained 37.63-46.97% of the association between different maltreatment subtypes and depression. The contribution of these two mediators differed by maltreatment subtypes, with social support being the major contributor to the mediating effect. The findings of the study not only provide scientific evidence on the importance of psychosocial attributes in the development of major depression but also suggest that prevention and invention strategies should focus on these psychosocial attributes to effectively break the vicious cycle of CM on major depression.