Researchers from several institutions in Norway studied 10,732 adults, with two batches of data taken 7-8 years apart.
The data compared exercise routines with pain tolerance, as measured via a cold pressor test, or CPT, where you dunk your hand into frigid water for as long as possible, up to a maximum tolerance time of 106 seconds.
The results were pretty consistent: Those who were more active were better at handling the pain of the cold water for a more extended period, and those who increased their activity levels over the two survey points increased their pain threshold too.
"Being physically active at either of two time points measured at a 7-8-year interval was associated with higher pain tolerance compared to being sedentary at both time points," write the researchers in their published paper.
"Pain tolerance increased with higher total activity levels and more for those who increased their activity level at follow-up."
It's worth noting that an observational study like this can't prove that more exercise is directly causing more resistance to pain; after all, it may be that other factors are playing the most significant roles. However, the link is strong enough to be notable.
The study showed that those who reported light levels of regular physical activity kept their hands submerged in icy water for an average of 6.7 seconds longer than those who didn't exercise at all.
For those who regularly engaged in vigorous physical activity, that went up to 16.3 seconds. For those participants who recorded high exercise levels at both survey points, the average went up to 20.4 seconds.
"These findings suggest that becoming or remaining active at a level above being sedentary, or making a positive change in activity level, over time is associated with higher pain tolerance as opposed to being sedentary or making a negative change," write the researchers.
While the participants in this study self-reported their exercise levels rather than having them scientifically assessed, the number of people involved in the study is relatively large, and smaller studies reached similar conclusions.
The researchers are also interested in the relationship between exercise and chronic pain. Previous research in this area is limited in scope but suggests a link between physical activity and how the body manages pain.
Further down the line, the increased pain tolerance observed here might reduce the risk of chronic pain developing later in life. There's not much evidence for it right now, but it's something that the study authors want to see investigated in the future.
"These results support increased physical activity levels as a possible non-pharmacological pathway towards reducing or preventing chronic pain," write the researchers.
The research has been published in PLOS ONE.