Background Life expectancy at birth in Mexico has stagnated since the early 2000s. As the COVID-19 pandemic hit, Mexico experienced sizable excess mortality, albeit with large regional variation. We aimed to assess the contribution of violence, COVID-19, and causes of death amenable to healthcare to life expectancy changes between 2015 and 2021 in Mexico. Methods We used administrative mortality data by causes of death, and adjusted population exposures from the National Population Council. We applied demographic decomposition methods to assess life expectancy changes at the subnational level, by year and sex. Findings Life expectancy between 2015 and 2019 declined from 71.8 to 71.1 years for males and stagnated at 77.6 years for females. Violence among young males accounted for 54.3% of life expectancy losses. Between 2019 and 2020, life expectancy decreased by 7.1 and 4.4 years for males and females, respectively. COVID-19 deaths accounted for 55.4% (males) and 57.7% (females). In 2021, male life expectancy stagnated at 64.1 years due to reductions in deaths due to amenable diseases but continued increasing for females by 0.44 years mainly due to reductions in COVID-19 deaths. Interpretation We document large variations in life expectancy losses across Mexican states, which are associated with preexistent high levels of violence, and socioeconomic disadvantages across geographical areas. Our results serve as a reminder that violence has negative health implications for both sexes and that COVID-19 affected more socially disadvantaged states.