Background Cognitive impairment may cause significant decline in muscle function and physical performance via affecting the neuromotor control. Aim To investigate the relationship between cognition and sarcopenia-related parameters in middle-aged and older adults. Methods Demographic data and comorbidities of adults >= 45-year-old were noted. The Mini-Mental State Examination (MMSE) was used to evaluate global cognitive function. Sonographic anterior midthigh muscle thickness, handgrip strength, chair stand test (CST) and gait speed were measured. The diagnosis of sarcopenia was established if low muscle mass was combined with low muscle function. Dynapenia was defined as low grip strength or increased CST duration. Results Among 1542 subjects (477 M, 1065 F), sarcopenia and dynapenia were detected in 22.6 and 17.2% of males, and 17.2 and 25.3% of females, respectively. Sarcopenic patients were older and had higher body mass index, higher frequencies of hypertension, diabetes mellitus and obesity. They had lower muscle thickness, grip strength in males only, CST performance in females only and gait speed than the other groups (all p < 0.05). Sarcopenic and dynapenic patients had similar MMSE scores which were lower than those of normal subjects (both p < 0.001). After adjusting for confounding factors, MMSE values were positively related with grip strength in females only, CST performance and gait speed (all p < 0.001); but not with muscle thickness in either gender. Conclusion Cognitive impairment may unfavorably affect muscle function and physical performance, but not muscle mass. Accordingly, its prompt management can help to decrease patient morbidity and mortality.