BACKGROUND: Observational data suggests that low vitamin D status is associated with an increased incidence of pulmonary tuberculosis (TB) and mortality among people living with HIV. The primary aims of this study were to assess the effect of vitamin D(3) supplementation on the risk of mortality and incidence of pulmonary TB among adults initiating antiretroviral therapy (ART). METHODS: We conducted a randomized, double-blind, placebo-controlled trial of vitamin D(3) supplementation among adults living with HIV who initiated ART with low serum 25-hydroxyvitamin D (25(OH)D) levels at four large HIV care and treatment centers in Dar es Salaam, Tanzania. The vitamin D group received weekly 50,000 IU vitamin D(3) supplements for the first month of ART followed by daily 2,000 IU vitamin D(3) supplements. The placebo arm received a matching weekly and daily placebo regimen. The trial follow-up duration was one year and the primary efficacy outcomes were death and incident pulmonary TB. An intent-to-treat analysis was followed. This study is registered with ClinicalTrials.gov, NCT01798680, and is completed. FINDINGS: Between 24 February 2014 and 7 March 2018, 4,000 adults initiating ART were enrolled in the trial and followed-up for one year. A total of 415 deaths were recorded; 211 in the vitamin D(3) group and 204 in the placebo group. Among all randomized participants, there was no overall effect of vitamin D(3) supplementation on the risk of mortality (hazard ratio (HR): 1·04; 95% CI: 0·85–1·25; P=0·73). There was also no difference in the overall incidence of pulmonary TB between the vitamin D(3) (50 events) and placebo groups (67 events) (HR: 0·78; 95% CI: 0·54–1·13; P=0·19). In terms of adverse events, the vitamin D(3) regimen did not increase the risk of hypercalcemia (3 events vitamin D(3) group, 2 events placebo group, relative risk: 1.25; 95% CI: 0.43–3.66; Fisher’s exact P =1·00). There were 101 hospitalizations reported in the vitamin D(3) group and 94 in the placebo group (incidence rate ratio: 1.06; 95% CI: 0.80–1.41; P=0·66). INTERPRETATION: Additional research is needed before vitamin D(3) supplementation should be considered for implementation in HIV care and treatment programs for the prevention of pulmonary TB or mortality.