Objective To explore the association between serum bone metabolic markers,bone mineral density(BMD),and cognitive impairment(CI)in middle-aged and elderly hospitalized patients,and to provide a basis for early detection and diagnosis of CI patients.Methods A total of 174 hospitalized patients attending the First Affiliated Hos-pital of University of Science and Technology of China from March 2021 to November 2023 were enrolled in this study,Cognitive function was assessed using the Mini-Mental State Examination(MMSE).The subjects were divided into a cognitive impairment group(n=70)and a normal control group(n=104)based on their MMSE scores.Bone density measurements and bone metabolism markers were compared between the two groups,and the correlation between cogni-tive function and bone-related parameters was analyzed.Results Compared with the normal control group,the cognitive impairment group exhibited lower levels of education(P<0.05),while there were no statistically significant differences between the two groups in terms of age,gender,history of diabetes,hyperlipidemia,or hypertension(P>0.05).The cognitive impairment group showed statistically significant decreases in osteocalcin,calcium levels,and lumbar spine L1 bone mineral density T-score compared to the normal control group(P<0.05).Additionally,there was a negative cor-relation observed between elevated levels of osteocalcin and the occurrence of cognitive impairment(OR=0.91,P<0.01).Conclusions Impaired cognitive function in middle-aged and elderly hospitalized patients may be associated with osteocalcin levels,and higher osteocalcin is an independent protective factor for cognitive function.