BackgroundPrevious studies underscore the protective role of physical activity (PA) in bone health, yet the relationship between different PA categories and osteoporosis risk remains less explored. Understanding the relationships helps tailor health recommendations and policies to maximize the effects of preventing osteoporosis. MethodsThe cross-sectional study involves 488,403 UK Biobank participants with heel quantitative ultrasound-estimated bone mineral density (eBMD) data. The longitudinal cohort involves 471,394 UK Biobank participants without initial osteoporosis and with follow-up records. PA exposure categories in our study included sedentary behavior (SB), total PA (TPA), and different category-specific PA including household, leisure, and work PA. The cases of osteoporosis were assessed using the International Classification of Diseases, 10th revision (ICD-10). The linear, logistic, and Cox proportional hazard regression models were used in our study. ResultsIn the cross-sectional study, 15,818 (3.28 %) participants had osteoporosis. TPA levels have a positive correlation with eBMD and a negative correlation with osteoporosis prevalence. Among different categories of PA, higher levels of leisure PA were correlated with increased eBMD and a lower osteoporosis risk (leisure PA: OR: 0.83, 95 % CI: 0.79 to 0.86;). In the longitudinal study, 16,058 (17.6 % male, 82.4 % female) (3.41 %) individuals developed osteoporosis during an average follow-up of 13 years. We observed consistent protective effects of high levels of PA on osteoporosis incidence risk, particularly within the category of leisure PA (TPA: HR: 0.78, 95 % CI: 0.74 to 0.82; leisure PA:HR: 0.83, 95 % CI: 0.80 to 0.87). Such associations are independent of genetic predisposition, with no evidence of gene-PA interactions, and keep steady among individuals using drugs affecting bone-density. Moreover, among different leisure PA items, strenuous sports, other exercises, and walking for pleasure conferred a substantial protective effect against osteoporosis. Additionally, non-elderly individuals and males exhibited lower osteoporosis risk from PA. ConclusionThis study highlights activity categories differently associated with the risk of osteoporosis. Adherence to frequent leisure PA may have a protective effect against osteoporosis. Such associations are independent of genetic susceptibility to osteoporosis and keep steady among individuals using drugs affecting bone-density. This highlights that leisure PA could be suggested as a more effective intervention in the primary prevention of osteoporosis.