While earnings manipulation has a broad literature in the private sector, there is a lack of research on this topic in the public sector. This paper aims to explore the level of earnings management in Spanish provincial councils. The use of accrual accounting may be viewed negatively by stakeholders such as the central government, opposition parties, and citizens. The public choice theory highlights the conflicting interests of politicians seeking re-election and citizens aiming to maximize their welfare, leading to potential manipulation of earnings. Discretionary accruals are used as a proxy for earnings management in this study. Additionally, the impact of financial sustainability measures on earnings management is examined. The analysis covers the period from 2017 to 2020 and reveals how certain financial sustainability ratios and pre-election years can influence the extent of earnings manipulation. This paper contributes to the existing literature on earnings management in local governments by examining the connection between financial sustainability indicators and this behavior. Specifically, it focuses on the relationship between budget vulnerability and sustainability, and their influence on the magnitude of discretionary accruals.