Retirement is a major life transition affecting health and health behaviour, but evidence on how this transition contributes to changes in healthy food habits is scarce. We examined whether the consumption of fruit and vegetables as well as fish changes after transition into statutory retirement. The data were derived from the prospective Helsinki Health Study. At phase 1 in 2000–2002, all participants were 40- to 60-year-old employees of the City of Helsinki, Finland (n 8960, response rate 67 %). Follow-up surveys were conducted in 2007, 2012 and 2017 (response rates 79–83 %). Using the four phases, we formed three nested cohorts in which the participants either continued working or moved to statutory retirement. The final analytical sample consisted of 6887 participants (14 357 observations). Frequency of fruit, vegetable and fish consumption was calculated from a twenty-two-item FFQ. Analyses of repeated measures of food consumption before and after retirement transition were conducted with a negative binomial mixed model, adjusting for age, marital status, limiting long-standing illness and household income. During the follow-up, altogether 3526 participants retired. Transition to retirement was associated with a decrease in vegetable consumption among women and, contrarily, with an increase in fruit consumption among men (P < 0·05 for interaction between time and employment status). Fish consumption did not differ by the change in employment status. Statutory retirement can have mixed effects on healthy food habits, and these can differ between food groups and sex. Healthy food habits should be promoted among employees transitioning to retirement.