Preclinical studies suggest that exposure to prostate-directed local therapy (LT) may influence the efficacy of subsequent systemic therapy including androgen receptor pathway inhibitors. However, there is insufficient clinical evidence to support this premise in patients with nonmetastatic castrate-resistant prostate cancer (nmCRPC). To determine whether exposure to prior prostate-directed LT (radical prostatectomy [RP], radiation therapy [RT], or both) played any effect-modifying role in the treatment effect of apalutamide on metastasis-free survival (MFS) and overall survival (OS) in patients with nmCRPC. This post hoc secondary analysis used individual patient data from SPARTAN (Study of Apalutamide [ARN-509] in Men With Non-Metastatic Castration-Resistant Prostate Cancer), a phase 3, double-blinded, placebo-controlled randomized clinical trial conducted at 332 sites in 26 countries. Between October 14, 2013, and December 15, 2016, patients with nmCRPC and a prostate-specific antigen doubling time of 10 months or less were randomly assigned to apalutamide vs placebo; all patients received androgen deprivation therapy. The final data analysis was performed on December 31, 2023. Prior prostate-directed LT. Separate Cox proportional hazards regression models were constructed for OS and MFS, which included prior LT, treatment group, and an interaction term, in addition to a minimally sufficient set of confounders. Adjusted hazard ratios (HRs) with 95% CIs for MFS and OS were determined for the apalutamide groups with or without prior LT. Among the 1179 evaluable patients included in this analysis, 795 received prior LT and 384 did not. The median age of patients with and without prior LT was 70 (IQR, 45-90) years and 75 (IQR, 50-95) years, respectively. The median follow-up was 52.0 (IQR, 51.5-52.8) months. A differential treatment effect of apalutamide on MFS was observed between patients with and without prior LT (P for interaction = .009), with greater benefits for those with prior LT (adjusted HR, 0.22 [95% CI, 0.17-0.27]) compared with those without prior LT (adjusted HR, 0.35 [95% CI, 0.25-0.51]). However, there was insufficient evidence of a differential treatment effect on OS among subgroups stratified by exposure to prior LT (P for interaction = .23), with improved OS in the subgroup with prior LT (adjusted HR, 0.72 [95% CI, 0.57-0.92]) but no significant difference in OS in the subgroup without prior LT (adjusted HR, 0.92 [95% CI, 0.64-1.31]). This post hoc analysis of the SPARTAN trial provides evidence of an interaction between prior LT and apalutamide in patients with nmCRPC, with a clinically significant and more favorable treatment effect from apalutamide on MFS among patients with prior LT. Further studies are needed to validate these findings. ClinicalTrials.gov Identifier: NCT01946204.