ObjectiveThis study investigates the associations and mediating pathways between grip strength, cognitive function, and depression in middle-aged and elderly individuals in China.MethodsUtilizing data from the 2011 China Health and Retirement Longitudinal Study (CHARLS), we employed logistic regression and mediation analysis to examine the relationships and mediating factors between grip strength, cognitive function, and depression, while adjusting for potential confounders.ResultsThe study included 6,841 participants, of whom 1,734 (25.35%) exhibited symptoms of depression. Our findings indicate that weak grip strength is significantly associated with an increased risk of depression (OR: 1.57, 95% CI: 1.32–1.87) among the middle-aged and elderly population. Conversely, good cognitive function was found to be protective against depression (OR: 0.94, 95% CI: 0.93–0.95). Grip strength indirectly affected depression through cognitive function, accounting for 9.4% of the total effect (β = −0.008, 95% CI [−0.013, −0.004]). This mediating effect was 23.8% in men (β = −0.013, 95% CI [−0.020, −0.007]); and 23.2% in those aged 60 years and over (β = −0.015, 95% CI [−0.022, −0.009]).ConclusionThis study highlights that weak grip strength increases risk of depressive symptoms, and adequate cognitive function can mitigate the association between weak grip strength and an increased risk of depression among middle-aged and elderly individuals in China. Psychological care for elder adults with weak grip strength and poor cognitive function should be strengthened.