Background: Smoking, unhealthy alcohol consumption, poor diet and physical inactivity are leading risk factors for morbidity and mortality, and contribute substantially to overall healthcare costs. The availability of health surveys linked to health care provides population-based estimates of direct healthcare costs. We estimated health behaviour and socioeconomic-attribute healthcare costs, and how these have changed during a period when government policies have aimed to reduce their burden. Methods: The Ontario samples of the Canadian Community Health Surveys (conducted in 2003, 2005, and 2007-2008) were linked at the individual level to all records of health care use of publicly funded healthcare. Generalized linear models were estimated with a negative binomial distribution to ascertain the relationship of health behaviours and socioeconomic risk factors on health care costs. The multivariable cost model was applied to unlinked, Ontario CCHS samples for each year from 2004 to 2013 to examine the evolution of health behaviour and socioeconomic-attributable direct health care expenditures over a 10-year period. Results: We included 80,749 respondents, aged 25 years and older, and 312,952 person-years of follow-up. The cost model was applied to 200,324 respondents aged 25 years and older (CCHS 2004 to 2013). During the 10-year period from 2004 to 2013, smoking, unhealthy alcohol consumption, poor diet and physical inactivity attributed to 22% of Ontario's direct health care costs. Ontarians in the most disadvantaged socioeconomic position contributed to 15% of the province's direct health care costs. Combined, these health behaviour and socioeconomic risk factors were associated with 34% ($134 billion) of direct health care costs (2004 to 2013). Over this time period, we estimated a 1.9% reduction in health care expenditure ($5.0 billion) attributable to improvements in some health behaviours, most importantly reduced rates of smoking. Conclusions: Adverse health behaviours and socioeconomic position cause a large direct health care system cost burden.