ObjectiveTo estimate smoking-related mortality and its contribution to educational inequalities in life expectancy in Spain.DesignNationwide, observational study from 2016 to 2019. Population-attributable fractions were used to estimate age, sex and education-specific cause-of-death smoking-attributable mortality. Life table techniques and decomposition methods were used to estimate potential gains in life expectancy at age 35 and the cause-specific contributions of smoking-related mortality to life expectancy differences across educational groups.SettingSpain.ParticipantsWe use cause-specific mortality data from population registers and smoking prevalence from the National and the European Health Survey for Spain from 2017 and 2019/2020, respectively.ResultsWe estimated 219 086 smoking-related deaths during 2016–2019, equalling 13% of all deaths, 83.7% of those in men. In the absence of smoking, potential gains in male life expectancy were higher among the low-educated than the high-educated (3.1 vs 2.1 years). For women, educational differences were less and also in the opposite direction (0.6 vs 0.9 years). The contribution of smoking to life expectancy differences between high-educated and low-educated groups accounted for 1.5 years among men, and −0.2 years among women. For men, the contribution of smoking to these differences was mostly driven by cancer in middle age, cardiometabolic diseases at younger ages and respiratory diseases at older ages. For women, the contribution to this gap, although negligible, was driven by cancer at older ages among the higher educated.ConclusionsSmoking remains a relevant preventable risk factor of premature mortality in Spain, disproportionately affecting life expectancy of low-educated men.