Identifying modifiable lifestyle behaviours that facilitate healthy cognitive ageing is of major public interest for the prevention of cognitive decline and dementia. Gardening is associated with numerous health benefits, yet few studies have explored the significance of gardening activity in relation to cognitive ageing. Here, longitudinal cognitive data from 467 older adults (aged 79 ± 0.6) of the LBC1921 study were used to examine associations of self-reported gardening at age 79 with lifetime cognitive change (age 11 to 79), and cognitive level (age 79) and slope across later life (age 79 to 90). Cognitive function was assessed at age 11 and 79 using the Moray House Test (MHT), and a battery of psychometric tests assessed cognitive function at ages 79, 83, 87 and 90 (MHT, Raven's Matrices, Verbal Fluency, Logical Memory). Models controlled for individual-level socio-demographic, lifestyle and health covariates including overall physical activity. Higher frequency of gardening was significantly associated with greater lifetime cognitive gain from age 11 to 79 on the MHT (std β = 0.112 P = 0.024), higher general cognitive ability (g) level at age 79 (std β = 0.145, P = 0.001), and higher test-specific scores on the MHT (std β = 0.153, P = 0.001) and Raven's Matrices (std β = 0.102, P = 0.040). Gardening was not associated with subsequent cognitive slopes from age 79 to 90. Overall, these findings suggest that engaging in gardening activities may contribute modestly to healthy cognitive functioning up to the eighth decade of life. Although physical activity was higher in gardeners, it did not explain the gardening and cognitive function relationship.