Economic recession might worsen health in low-income and middle-income countries with precarious job markets and weak social protection systems. Between 2014-16, a major economic crisis occurred in Brazil. We aimed to assess the association between economic recession and adult mortality in Brazil and to ascertain whether health and social welfare programmes in the country had a protective effect against the negative impact of this recession. In this longitudinal analysis, we obtained data from the Brazilian Ministry of Health, the Brazilian Institute for Geography and Statistics, the Ministry of Social Development and Fight Against Hunger, and the Information System for the Public Budget in Health to assess changes in state unemployment level and mortality among adults (aged ≥15 years) in Brazil between 2012 and 2017. Outcomes were municipal all-cause and cause-specific mortality rates for all adults and across population subgroups stratified by age, sex, and race. We used fixed-effect panel regression models with quarterly timepoints to assess the association between recession and changes in mortality. Mortality and unemployment rates were detrended using Hodrick-Prescott filters to assess cyclical variation and control for underlying trends. We tested interactions between unemployment and terciles of municipal social protection and health-care expenditure to assess whether the relationship between unemployment and mortality varied. Between 2012 and 2017, 7 069 242 deaths were recorded among adults (aged ≥15 years) in 5565 municipalities in Brazil. During this time period, the mean crude municipal adult mortality rate increased by 8·0% from 143·1 deaths per 100 000 in 2012 to 154·5 deaths per 100 000 in 2017. An increase in unemployment rate of 1 percentage-point was associated with a 0·50 increase per 100 000 population per rter (95% CI 0·09-0·91) in all-cause mortality, mainly due to cancer and cardiovascular disease. Between 2012 and 2017, higher unemployment accounted for 31 415 excess deaths (95% CI 29 698-33 132). All-cause mortality increased among black or mixed race (pardo) Brazilians (a 0·46 increase [95% CI 0·15-0·80]), men (0·67 [0·22-1·13]), and individuals aged 30-59 years (0·43 [0·16-0·69] per 1 percentage-point increase in the unemployment rate. No significant association was identified between unemployment and all-cause mortality for white Brazilian, women, adolescents (aged 15-29 years), or older and retired individuals (aged ≥60 years). In municipalities with high expenditure on health and social protection programmes, no significant increases in recession-related mortality were observed. The Brazilian recession contributed to increases in mortality. However, health and social protection expenditure seemed to mitigate detrimental health effects, especially among vulnerable populations. This evidence provides support for stronger health and social protection systems globally. None.