Objective: The aim of the study was to examine the effects of the vitamin D (Vit-D) treatment and nontreatment on Vit-D-deficient patients without a prior history of myocardial infarction (MI). Materials and Methods: This was a retrospective, observational, nested case-control study of patients (N = 20 025) with low 25-hydroxyvitamin D ([25-OH]D) levels (<20 ng/mL) who received care at the Veterans Health Administration from 1999 to 2018. Patients were divided into 3 groups: Group A (untreated, levels <= 20 ng/mL), Group B (treated, levels 21-29 ng/mL), and Group C (treated, levels >= 30 ng/mL).The risk of MI and all-cause mortality were compared utilizing propensity score-weighted Cox proportional hazard models. Results. Among the cohort of 20 025 patients, the risk of MI was significantly lower in Group C than in Group B (hazard ratio [HR] 0.65, 95% CI 0.49-0.85, P= .002) and Group A (HR 0.73, 95% CI 0.55-0.96), P= .02).There was no difference in the risk of MI between Group B and Group A (HR 1.14, 95% CI 0.91-1.42, P= 0.24). Compared with Group A, both Group B (HR 0.59, 95% CI 0.54-0.63, P< .001) and Group C (HR 0.61, 95% CI 0.56-0.67, P< .001) had significantly lower all-cause mortality.There was no difference in all-cause mortality between Group B and Group C (HR 0.99, 95% CI 0.89-1.09, P= .78). Conclusions. In patients with Vit-D deficiency and no prior history of MI, treatment to the (25-OH)D level of >20 ng/mL and >30 ng/mL was associated with a significantly lower risk of all-cause mortality.The lower risk of MI was observed only in individuals maintaining (25-OH)D levels >= 30 ng/mL.