Background: Physical therapy and exercising are key components of biopsychosocial rehabilitation for chronic pain. Exercise helps reduce pain and improve physical functions. In addition, a high level of physical activity benefits quality of life and emotional well-being. However, the degree to which hospitalization for extensive rehabilitation effectively increases physical activity has not yet been studied. Therefore, we investigated the physical activity level and the walking behavior of inpatients with musculoskeletal pain. The objectives were 1) to compare physical activity level and walking with or without rehabilitation, 2) to evaluate whether pain site influences physical activity level, and 3) to measure the association between physical activity and pain-related interference with physical functioning. Methods: During a rehabilitation stay, 272 inpatients with lower limb, spine, or upper limb pain wore an accelerometer over 1 week. We assessed the daily duration of the practice of moderate physical activity and walking. Weekend days, during which the participants went home (days off), were used as a reference for habitual activities. We also evaluated 93 patients before the hospitalization to validate the use of days off as a baseline. Pain interference was measured with the brief pain inventory questionnaire. Generalized linear mixed models analyzed the association between physical activity and walking levels, and 1) rehabilitation participation, 2) pain sites, and 3) pain interference. Results: Weekend days during the stay have similar physical activity level as days measured before the stay (73 min / day at the clinic, versus 70 min / day at home). Rehabilitation days had significantly higher physical activity levels and walking durations than days off (+ 28 min [+ 37%] and + 32 min [+ 74%], respectively). Mixed models revealed 1) a negative association between physical activity and pain interference, and 2) no effect of pain sites. Overall, patients increased their physical activity level independently of reported pain interference. Conclusions: Despite their painful condition, the inpatients were able to engage themselves in a higher level of physical activity via increased participation in walking activities. We conclude that walking incentives can be a valid solution to help patients with chronic pain be more physically active.