Background: Population-based studies show there is a high prevalence of chronic kidney disease (CKD) patients suffering from chronic pain. While opiates are frequently prescribed in non-dialysis-dependent CKD (NDD-CKD) patients, there may be toxic accumulation of metabolites, particularly among those progressing to end-stage renal disease (ESRD). We examined the association of opiate versus other analgesic use during the pre-ESRD period with post-ESRD mortality among NDD-CKD patients transitioning to dialysis. Methods: We examined a national cohort of US Veterans with NDD-CKD who transitioned to dialysis over 2007-14. Among patients who received ≥1 prescription(s) in the Veterans Affairs (VA) Healthcare System within 1 year of transitioning to dialysis, we examined associations of pre-ESRD analgesic status, defined as opiate, gabapentin/pregabalin, other nonopiate analgesic, versus no analgesic use, with post-ESRD mortality using multivariable Cox models. Results: Among 57,764 patients who met eligibility criteria, pre-ESRD opiate and gabapentin/pregabalin use were each associated with higher post-ESRD mortality (ref: no analgesic use), whereas non-opiate analgesic use was not associated with higher mortality in expanded case-mix analyses: HRs (95% CIs) 1.07 (1.05-1.10), 1.07 (1.01-1.13), and 1.00 (0.94-1.06), respectively. In secondary analyses, increasing frequency of opiate prescriptions exceeding 1 opiate prescription in the 1-year pre-ESRD period was associated with incrementally higher post-ESRD mortality (ref: no analgesic use). Conclusions: In NDD-CKD patients transitioning to dialysis, pre-ESRD opiate and gabapentin/pregabalin use were associated with higher post-ESRD mortality, whereas non-opiate analgesic use was not associated with death. There was a graded association between increasing frequency of pre-ESRD opiate use and incrementally higher mortality.