Head and neck cancer (HNC) survivors are about twice as likely to die by suicide compared with other cancer survivors. To examine the associations between precancer mental health and pain and postcancer receipt of mental health, substance use disorder (SUD), or palliative care services with risk of suicidal self-directed violence (SSDV). This retrospective cohort study used the Veterans Health Administration data of 7803 veterans with a diagnosis of HNC (stage I-IVB) who received cancer treatment between January 1, 2012, and January 1, 2018. Data were analyzed between May 2020 and July 2021. Presence of precancer chronic pain and SUD diagnoses, and postcancer SUD, mental health, or palliative care treatment. Exposures were defined using International Classification of Diseases, Ninth Revision and International Statistical Classification of Diseases and Related Health Problems, Tenth Revision codes in Veterans Health Administration administrative data. Documented SSDV event, including suicide attempt or death by suicide, after HNC diagnosis. Among the cohort of 7803 veterans (7685 [98.4%] male; mean [SD] age, 65 [10.7] years), 72 (0.9%) had at least 1 documented SSDV event following their cancer diagnosis, and 51 (0.7%) died by suicide. Four adjusted modified Poisson regression analyses identified that precancer chronic pain (incidence rate ratio [IRR], 2.58; 95% CI 1.54-4.32) or mood disorder diagnoses (IRR, 1.95; 95% CI, 1.17-3.24) were associated with higher risk of postcancer SSDV. Those who had at least 1 documented mental health (IRR, 2.73; 95% CI, 1.24-6.03) or SUD (IRR, 3.92; 95% CI, 2.46-6.24) treatment encounter in the 90 days following HNC diagnosis were at higher risk for SSDV. A palliative care encounter within 90 days of postcancer diagnosis was associated with decreased risk of SSVD (IRR, 0.49; 95% CI, 0.31-0.78). In this cohort study, a high proportion of HNC survivors with an SSVD event died from their injuries. Identification of risk factors for SSDV among HNC survivors may help direct additional resources to those who are at high risk. Referral to palliative care appears to be an important component of supportive oncologic care to reduce the risk of SSDV.