There is growing evidence that suggests the association of vitamin D status with the development and progression of heart failure (HF). The objective of the present study is to assess the impact of concentration of serum 25-hydroxyvitamin D (25(OH)D) on cardiac prognosis in patients with HF. Between 1 January 2015 and 31 December 2016, we consecutively recruited patients with HF. Patients were followed prospectively for a median duration of 1 year. Serum concentration of 25(OH)D was measured with competitive chemiluminescent immunoassay. The endpoints were cardiac events, including CVD death and rehospitalisation for worsening HF. Univariate and multivariable adjustments were performed with Cox proportional-hazard regression analyses. The 25(OH)D concentration was obtained in 343 patients with a median value of 17·4 (interquartile range 12·6–23·4) ng/ml. There were 102 cardiac events, including forty-three deaths and fifty-nine rehospitalisations. Multivariate Cox hazard analysis found that the serum concentration 25(OH)D was independently associated with cardiac events (hazard ratio 0·93, 95 % CI 0·88, 0·97) and CVD mortality (hazard ratio 0·83; 95 % CI 0·77, 0·89) after adjustment for confounding factors. We divided the HF patients into four groups according to the 25(OH)D quartiles. Kaplan–Meier analysis found that the patients with lower serum 25(OH)D concentration had a higher risk of cardiac events or CVD mortality than those with high serum 25(OH)D concentration (log-rank test P < 0·001 and P = 0·032). Decreased serum concentrations of 25(OH)D were associated with cardiac prognosis and CVD mortality in a Chinese population with HF independent of other baseline HF markers.