Background: Dietary guidelines emphasize the consumption of plant-based protein foods for cardiovascular health. However, it remains unclear how the balance of plant- and animal-based protein food consumption contributes to muscle health. Objective: Our objective was to estimate the effect of increasing the consumption of plant- (PLANT) relative to animal-based (ANIMAL) protein foods on physical function, including muscle function, strength, and lean mass, in middle-aged and older adults. We also examined the effects of increasing both protein sources (BOTH), within a healthy dietary pattern (HEALTHY), or limiting animal protein foods consumption (HEALTHY-P+). Methods: Non-experimental data from the Canadian Longitudinal Study on Aging (CLSA) comprehensive cohort were used to emulate a target trial. Middle-aged and older adults were followed for 6 years. Sociodemographic and diet data (frequency via the Short Diet Questionnaire) were assessed every three years. Objectively measured outcomes were muscle function (Timed Up&Go, 4-m walking speed, chair rise time), appendicular lean soft tissue (ALST) by dual-energy X-ray absorptiometry and handgrip strength. The parametric g-formula was used to account for time-varying confounding and loss to follow-up. Results: A total of 21,636 participants were eligible (median [Q1-Q3] age, 62 [54-70] years; 49% female). Across all hypothetical interventions, the HEALTHY intervention consistently improved outcomes. Compared with no intervention, HEALTHY yielded the largest estimated differences: Timed Up&Go (-0.15 s; 95%CI: -0.24, -0.07), chair rise time (-0.03 s; 95%CI: -0.06, -0.01), handgrip strength (+0.5 kg; 95%CI: 0.3, 0.7), and ALST (+0.12 kg, 95%CI: 0.05-0.18). BOTH showed consistent but smaller effect estimates. Further limiting animal protein did not confer additional benefits. Interventions increasing PLANT or ANIMAL alone showed 95%CIs compatible with no effect. Effect estimate magnitudes were below clinically important differences. Conclusion: In middle-aged and older adults, findings suggest that a balanced approach to increasing consumption of both animal and plant-based protein foods may yield modest benefits for muscle health compared with no intervention, particularly within a healthy dietary pattern.