Abstract Background Opioid crisis has become a global concern, but whether physical activity (PA) can effectively reduce prescription opioid use remains unclear. The study aimed to examine the relationship of different domains of PA (e.g., occupation-related PA [OPA], transportation-related PA [TPA], leisure-time PA [LTPA]) with prescription opioid use and duration of prescription opioid use. Methods This cross-sectional study was conducted on 27,943 participants aged ≥ 18 years from National Health and Nutrition Examination Survey (NHANES, 2007– March 2020). We examined the relationship of different domains of PA with prescription opioid use and duration of prescription opioid use using multivariable logistic regression. Stratified analysis and a series of sensitivity analysis were used to elevate robustness. All analyses were conducted using appropriate sampling weights. Results Of the 27,943 participants, the mean age was 45.10 years, with 14,018 [weighted, 50.0%] females and 11,045 [weighted, 66.0%] non-Hispanic White. After multivariable adjustment, inverse associations between PA and prescription opioid use were observed for sufficient (≥ 150 min/week) total PA (OR,0.68 95%CI [0.56–0.81]), TPA (OR,0.73 95%CI [0.58–0.92]), and LTPA (OR,0.60 95%CI [0.48–0.75]) compared with insufficient PA(