Physical activity is known to provide substantial health benefits and subsequently reduce health care use among older people, but little is known about how much of this effect is due to improved cognitive function as opposed to physical improvements in health. We study the direct and indirect effect of physical activity on health care use using the word recall task as a measure of cognitive function in a mediation framework. We use data from eight waves of the US Health and Retirement Study (HRS) (2004 - 2018) of people aged 65 and older and exploit genetic variations between individuals as an instrumental variable (IV) for cognitive function, a local health care supply measure as IV for health care use, and neighbourhood physical activity as IV for individual physical activity in our simultaneous three-equation model. We find small but negative direct and indirect effects of physical activity through improved cognitive function on the probability to see a GP and being admitted to a hospital, as well as the number of GP visits and the hospital length of stay. Improved cognitive function explains between 5% to 17% of the total effect of physical activity on the reduction in health care use.