BackgroundMood disorders in pregnancy and post-partum period are common and considered as a public health issue. Researchers have studied the relationship between low serum vitamin D concentration and perinatal depression, although no clinical trial has been conducted on vitamin D’s effects on depression related to childbirth. This study evaluated the effect of vitamin D3 supplementation on perinatal depression scores.MethodsThis randomized clinical trial was done in pregnant women who were under prenatal care in a teaching hospital in Shiraz, Iran. The inclusion criteria were: being 18 years or older, no history of mental illness and internal diseases, a singleton live fetus, without any pregnancy complications, gestational age of 26–28 weeks upon enrollment, and depression score of 0 to 13. The Edinburgh Postnatal Depression scale was used to evaluate depression scores. A total of 169 participants were assigned to the two groups of placebo and vitamin D through block randomization design. Vitamin D group received 2000 IU vitamin D3 daily from 26 to 28 weeks of gestation until childbirth. Maternal serum 25-hydroxyvitamin D concentrations were measured at baseline and childbirth. Besides, depression scores were evaluated four times: at 26–28 and 38–40 weeks of gestation, and finally at 4 and 8 weeks after birth.ResultsThe two groups were similar in relation to baseline 25-hydroxyvitamin D concentrations. However, at childbirth, the vitamin D group had significantly higher 25-hydroxyvitamin D concentration in comparison to the control group (p < 0.001). At baseline, no correlation was observed between 25-hydroxyvitamin D concentration and depression score (r = 0.13, p = 0.09). There was no significant difference between the two study groups in relation to the baseline depression score. While, the vitamin D group had greater reduction in depression scores than the control group at 38–40 weeks of gestation (p = 0.01) also, at 4 and 8 weeks after birth (p < 0.001).ConclusionsThe present trial showed that consuming 2000 IU vitamin D3 daily during late pregnancy was effective in decreasing perinatal depression levels. We suggest further clinical trial in pregnant mothers who are at risk for postnatal depression.Trial registrationIranian Registry of Clinical Trials IRCT2015020310327N11. Date of registration: March 9th 2015.Electronic supplementary materialThe online version of this article (doi:10.1186/s12884-016-1024-7) contains supplementary material, which is available to authorized users.