Importance Interventions to reduce postpartum depression have mainly focused on enhancing screening to increase treatment rates among women. Preventive approaches are timely from a population health perspective, particularly in low- and middle-income countries where access to mental health services is limited. Objective To assess the efficacy of regular exercise during pregnancy on the prevention of postpartum depression. Design, Setting, and Participants This randomized clinical trial examines a prespecified secondary outcome of the Physical Activity for Mothers Enrolled in Longitudinal Analysis (PAMELA) Study, a parallel-group, randomized clinical trial. This trial was nested in the 2015 Pelotas (Brazil) Birth Cohort Study. Between August 27, 2014, and March 14, 2016, pregnant women between 16 and 20 weeks of gestation with no contraindications to exercise were randomized 1:2 to the intervention group or control group via computer-generated randomization using a block size of 9. Data were analyzed from March 7 to May 2, 2018. Interventions Participants assigned to the intervention were engaged in a 16-week supervised exercise program including aerobic and resistance training delivered in 60-minute sessions 3 times per week. Main Outcomes and Measures Postpartum depressive symptoms were assessed with the Edinburgh Postnatal Depression Scale 3 months after birth. A score of 12 or greater was defined as screening positive for postpartum depression. Primary analysis was performed on a complete case basis (90% of participants who had the primary end point ascertained). Results A total of 639 participants (mean [SD] age, 27.1 [5.1] years; mean gestational age, 16.5 [1.5] weeks) were randomly assigned to the intervention group (n = 213) or control group (n = 426). Compliance with the protocol, defined as having engaged in at least 70% of exercise sessions, was low (40.4%). There was no significant difference in mean (SD) scores for postpartum depression between the intervention group (4.8 [3.7]) and the control group (5.4 [4.1]) (mean difference, −0.6; 95% CI, −1.3 to 0.1). There was also no significant difference in rates of postpartum depression between the intervention group (12 of 192 [6.3%]) and the control group (36 of 387 [9.3%]) (odds ratio, 0.65; 95% CI, 0.33-1.28). Instrumental variable analysis indicated that noncompliance may have attenuated the effect estimates obtained in the primary analysis. Conclusions and Relevance Moderate-intensity exercise during pregnancy did not lead to significant reductions in postpartum depression. However, noncompliance to the intervention protocol was substantial and may have led to underestimations of the possible benefits of exercise. The point estimates for this study are in the same direction as the previous randomized clinical trial on this topic. Future studies on how to promote regular exercise during pregnancy to improve compliance, particularly targeting young and less educated women, are warranted before further trials are undertaken