In many workplaces, the coronavirus disease 2019 pandemic changed work arrangements, but there is scarce longitudinal evidence on whether psychosocial work environment and employee well-being were affected. To examine the psychosocial work environment and employee well-being before, during and after the pandemic in relation to pandemic-induced changes (working from home, change to other tasks and team reorganization). Survey data from a cohort of 20944 public sector employees in Finland were collected before (2016-2018), during (2020) and after the pandemic (2022). Multilevel linear and logistic regression was used to examine group differences between the before-during and during-after periods of the pandemic. Working from home was associated with a small but favourable change in worktime control, organizational justice and social capital (scale 1-5) during the pandemic and after the pandemic (marginal mean difference ranging from 0.02 to 0.09 with 95% confidence intervals [CIs] from 0.01 to 0.10). There was a post-pandemic increase in work time control, even among participants with a transfer into other tasks (0.11, 95% CI 0.07, 0.14) or team reorganization (0.06, 95% CI 0.02, 0.10). The decline in self-rated work ability (scale 0-10) before and during the pandemic was greater in those transferred into other tasks (-0.10, 95% CI -0.13, -0.06) than in those not (-0.05, 95% CI -0.06, -0.04). Working from home during the pandemic was accompanied by small favourable changes in the psychosocial work environment during the pandemic, whereas transition to different tasks was associated with a decline in self-rated work ability.