Background Breast cancer is the most common cancer diagnosed in women globally, and 5-year net survival probabilities in high-income countries are generally >80%. A cancer diagnosis and treatment are often traumatic events, and many women struggle to cope during this period. Less is known, however, about the long-term mental health impact of the disease, despite many women living several years beyond their breast cancer and mental health being a major source of disability in modern societies. The objective of this study was to quantify the risk of several adverse mental health-related outcomes in women with a history of breast cancer followed in primary care in the United Kingdom National Health Service, compared to similar women who never had cancer. Methods and findings We conducted a matched cohort study using data routinely collected in primary care across the UK to quantify associations between breast cancer history and depression, anxiety, and other mental health-related outcomes. All women with incident breast cancer in the Clinical Practice Research Datalink (CPRD) GOLD primary care database between 1988 and 2018 (N = 57,571, mean = 62 +/- 14 years) were matched 1:4 to women with no prior cancer (N = 230,067) based on age, primary care practice, and eligibility of the data for linkage to hospital data sources. Cox models were used to estimate associations between breast cancer survivorship and each mental health-related outcome, further adjusting for diabetes, body mass index (BMI), and smoking and drinking status at baseline. Breast cancer survivorship was positively associated with anxiety (adjusted hazard ratio (HR) = 1.33; 95% confidence interval (CI): 1.29-1.36; p < 0.001), depression (1.35; 1.32-1.38; p < 0.001), sexual dysfunction (1.27; 1.17-1.38; p < 0.001), and sleep disorder (1.68; 1.63-1.73; p < 0.001), but not with cognitive dysfunction (1.00; 0.97-1.04; p = 0.88). Positive associations were also found for fatigue (HR = 1.28; 1.25-1.31; p < 0.001), pain (1.22; 1.20-1.24; p < 0.001), receipt of opioid analgesics (1.86; 1.83-1.90; p < 0.001), and fatal and nonfatal self-harm (1.15; 0.97-1.36; p = 0.11), but CI was wide, and the relationship was not statistically significant for the latter. HRs for anxiety and depression decreased over time (p-interaction <0.001), but increased risks persisted for 2 and 4 years, respectively, after cancer diagnosis. Increased levels of pain and sleep disorder persisted for 10 years. Younger age was associated with larger HRs for depression, cognitive dysfunction, pain, opioid analgesics use, and sleep disorders (p-interaction <0.001 in each case). Limitations of the study include the potential for residual confounding by lifestyle factors and detection bias due to cancer survivors having greater healthcare contact. Conclusions In this study, we observed that compared to women with no prior cancer, breast cancer survivors had higher risk of anxiety, depression, sleep problems, sexual dysfunction, fatigue, receipt of opioid analgesics, and pain. Relative risks estimates tended to decrease over time, but anxiety and depression were significantly increased for 2 and 4 years after breast cancer diagnosis, respectively, while associations for fatigue, pain, and sleep disorders were elevated for at least 5-10 years after diagnosis. Early diagnosis and increased awareness among patients, healthcare professionals, and policy makers are likely to be important to mitigate the impacts of these raised risks. Author summary Why was this study done? More than 570,000 women are carrying on with their lives after having been diagnosed and treated for breast cancer in the UK. This number is expected to increase. Many women feel anxious and/or depressed while undergoing the cancer treatments, but it is less clear how their mental health fares in the longer term. The evaluation of the long-term mental health of these women is important to understand what their needs are and plan health services that are able to mitigate the long-term consequences of cancer. We aimed to estimate the risk of a range of mental health-related outcomes in a population-based sample of breast cancer survivors in the UK, compared to women with no prior cancer. What did the researchers do and find? This study compared the risk of several adverse mental health-related outcomes in 57,571 women with history of breast cancer and 230,067 women with no history of cancer followed in primary care in the UK. The results suggest that breast cancer survivorship is associated with raised risks of anxiety, depression, fatigue, sleep disorders, pain, and sexual dysfunction, persisting well into the survivorship period. What do these findings mean? Breast cancer survivorship is associated with raised risk of several adverse mental health-related outcomes. For all outcomes, the risk was particularly increased around diagnosis and during the period of the main treatments for breast cancer. Early diagnosis and management of these conditions is likely to be key to mitigate the impact on the long-term health of cancer survivors. Future studies might investigate whether screening breast cancer patients for mental disorders during this period could help identify patients struggling to cope and enable interventions to help reduce the long-term burden of the disease.