Objective The aims of this study were to study the mobility recovery in hip fracture patients and determine the influence of cognitive impairment on mobility within the first 3 months after surgery. Design This prospective cohort study was carried out in an acute public hospital in southern Spain and included 275 patients, 65 years or older, with a hip fracture. Mobility and Cognitive status were measured by Tinetti Performance-Oriented Mobility Assessment and Pfeiffers’ Scale (Short Portable Mental State Questionnaire), respectively. Multiple linear regression was used to examine the influence of cognitive impairment on mobility. Results The median Performance-Oriented Mobility Assessment score changed from 4 (3–4) points at discharge to 17 (7–22) at 3 months. All degrees of cognitive impairment were negatively associated with gait and balance at 1 and 3 months after surgery (P < 0.01). Age, weight bearing, length of hospital stay, and postsurgical complications were also identified as independent predictors of mobility outcome at 3 months. Conclusions Cognitive impairment is a negative prognostic factor for the recovery of mobility in elderly patients with a hip fracture. New treatment strategies are needed for hip fracture patients with cognitive impairment.