Abstract Background As retirement ages are increasing in Europe, more knowledge is needed on factors that are associated with extended working life. Our aim was to explore if prior sickness absence (SA) and/or disability pension (DP) due to mental and/or somatic diagnoses were associated with income from work after age 65 and 70, respectively. Methods A 4-year prospective population-based cohort study using microdata from nationwide registers. We included all who in 2014 were aged 65-69 (cohort A; n = 201,263) and ≥70 (cohort B; n = 93,751), respectively, had income from work in 2014 (baseline), and lived in Sweden in 2010-2015. Cox proportional hazard regression was used to calculate hazard ratios (HR) with 95% confidence intervals (CI) for associations between prior SA (in spells >14 days) and/or DP due to mental and/or somatic diagnoses, overall and stratified by the number of net days (2010-2014), and future years with income from work (2015-2018), censored for death and emigration, adjusted for sociodemographic and work-related factors, and stratified by sex. Results The majority had no SA or DP during the exposure interval (cohort A 66.3% women, 75.8% men; cohort B 96.8% women, 97% men). Many had income from work at some point during follow-up (cohort A 77.8% women, 81.6% men, cohort B 81.9% women, 83.4% men). Prior somatic SA/DP was associated with a marginally but significantly higher HR for earlier exit from paid work in cohort A (women 1.08; 95% CI: 1.06-1.10; men 1.10; 1.08-1.12), lower HR for men in cohort B (0.93; 0.86-0.99), and non-significant HR for women in cohort B. The corresponding association for mental SA/DP was significant only for women in cohort A (1.09; 1.06-1.13). Conclusions The likelihood of earlier exit from paid work was slightly higher for those aged 65-69 at baseline with prior somatic SA/DP, but lower for men aged ≥70 at baseline with prior somatic SA/DP. Prior mental SA/DP was associated with earlier exit only for women aged 65-69 at baseline. Key messages • Prior SA/DP was in many cases marginally but significantly associated with future income from work. The direction of association differed depending on the diagnosis of the spell, cohort and sex. • More knowledge is needed on how older workers with different types of morbidities and functional limitations can extend their working life in Sweden as well as in other European countries.