Increased intake of vegetables and fruits has been associated with reduced risk of tuberculosis infection. Vegetables and fruits exert immunoregulatory effects; however, it is not clear whether vegetables and fruits have an adjuvant treatment effect on tuberculosis. Between 2009 and 2013, a hospital-based cohort study was conducted in Linyi, Shandong Province, China. Treatment outcome was ascertained by sputum smear and chest computerised tomography, and dietary intake was assessed by a semi-quantitative FFQ. The dietary questionnaire was conducted at the end of month 2 of treatment initiation. Participants recalled their dietary intake of the previous 2 months. A total of 2309 patients were enrolled in this study. After 6 months of treatment, 2099 patients were successfully treated and 210 were uncured. In multivariate models, higher intake of total vegetables and fruits (OR 0·70; 95 % CI 0·49, 0·99), total vegetables (OR 0·68; 95 % CI 0·48, 0·97), dark-coloured vegetables (OR 0·61; 95 % CI 0·43, 0·86) and light-coloured vegetables (OR 0·67; 95 % CI 0·48, 0·95) were associated with reduced failure rate of tuberculosis treatment. No association was found between total fruit intake and reduced failure rate of tuberculosis treatment (OR 0·98; 95 % CI 0·70, 1·37). High intake of total vegetables and fruits, especially vegetables, is associated with lower risk of failure of tuberculosis treatment in pulmonary tuberculosis patients. The results provide important information for dietary guidelines during tuberculosis treatment.