Public pensions may influence labor supply throughout the lifecycle. In this paper, we exploit pension eligibility regulations to study how pension programs impact retirement and earlier-in-life labor supply decisions. Our context is Ecuador, where a workers eligibility age depends on the number of years they have contributed to the social security system. First, we use large-scale administrative data to document spikes in retirement at the pension eligibility ages of 60, 65, and 70. Next, we show how the increases in retirement at each of these eligibility ages are consistent with economic incentives and driven by different groups of people who begin working in the formal labor market at different ages. Finally, we use survey data and a regression discontinuity design to investigate whether eligibility rules influence earlier-in-life decisions about when to begin working in the formal sector. We find a discontinuous increase in transitions to formal work at age 50, consistent with forward-looking people timing their entrance to the formal sector to minimize contributions to the social security system while maintaining eligibility for benefits. Additional analyses on mechanisms shed light on the potential paths workers can take to facilitate these informal-to-formal transitions; the results suggest a key role for family firms.