Background There is significant variability in poststroke locomotor learning that is poorly understood and affects individual responses to rehabilitation interventions. Cognitive abilities relate to upper extremity motor learning in neurologically intact adults, but have not been studied in poststroke locomotor learning. Objective To understand the relationship between locomotor learning and retention and cognition after stroke. Methods Participants with chronic (>6 months) stroke participated in 3 testing sessions. During the first session, participants walked on a treadmill and learned a new walking pattern through visual feedback about their step length. During the second session, participants walked on a treadmill and 24-hour retention was assessed. Physical and cognitive tests, including the Fugl-Meyer-Lower Extremity (FM-LE), Fluid Cognition Composite Score (FCCS) from the NIH Toolbox -Cognition Battery, and Spatial Addition from the Wechsler Memory Scale-IV, were completed in the third session. Two sequential regression models were completed: one with learning and one with retention as the dependent variables. Age, physical impairment (ie, FM-LE), and cognitive measures (ie, FCCS and Spatial Addition) were the independent variables. Results Forty-nine and 34 participants were included in the learning and retention models, respectively. After accounting for age and FM-LE, cognitive measures explained a significant portion of variability in learning ( R2 = 0.17, P = .008; overall model R2 = 0.31, P = .002) and retention (Δ R2 = 0.17, P = .023; overall model R2 = 0.44, P = .002). Conclusions Cognitive abilities appear to be an important factor for understanding locomotor learning and retention after stroke. This has significant implications for incorporating locomotor learning principles into the development of personalized rehabilitation interventions after stroke.