AbstractEpidemiologists are warning that the next pandemic is almost around the corner. As we have seen during the COVID-19 pandemic, the death toll was at the highest for over 60th, transforming the population pyramids. In times of pandemics, two effects on sustainability of the pay-as-you-go (PAYG) pension scheme go in different directions: the increase in old-age mortality (leading to a decrease in pension spending) and the increase in unemployment (leading to a decline in income from contributions). In this paper, we investigate the long-term effects of pandemics on the financial sustainability of PAYG pension schemes, taking into account changes in both mortality and unemployment factors. Using functional data analysis we develop projections of population pyramids and allow for anticipated mortality jumps as a result of future pandemics. An application is carried out using mortality and fertility data from Spain. Given some plausible assumptions, our findings indicate, firstly, that the financial sustainability of the Spanish pension system is compromised. Secondly, in the event of a pandemic, we observe that financial sustainability is primarily driven by the mortality effect—resulting in a decrease in pension expenditure—while the impact of unemployment is almost negligible.