Background: To investigate the anxiety and depression of patients with advanced cancer who received immunotherapy using programmed death-1 or programmed death-ligand 1 after multiline treatment failure, to explore the influencing factors, and to provide reference for clinical medical staff and psychological support for patients.Methods: The Hospital Anxiety and Depression Scale was used to calculate the anxiety and depression scores before and after 1, 2 and 3 courses of treatment, respectively. The patients with anxiety and depression were counted. Purposive sampling was used to conduct face-to-face semi-structured interviews with 21 patients to find out the reasons. The obtained data were analyzed and collated using the Colaizzi's phenomenological method.Results: Before and after 1, 2 and 3 courses of treatment, 18.26%, 23.0%, 50% and 54% of patients suffered from anxiety and depression, respectively. Four related factors, i.e. low expectations for immunotherapy, lack of timely information after treatment, lack of awareness of treatment and drugs, and lack of family and social support, were extracted with the sampling survey. The proportion of patients with anxiety and depression during immunotherapy kept increasing.Conclusion: The anxiety and depression of patients with advanced cancer who receive immunotherapy after multiline treatment failure are aggravated along with treatment. Patients need to be given humane care and emotional support from their families, society and medical staff. Nursing staff should adopt personalized measures to meet the psychological needs of patients, and a targeted and complete nursing system should be established to extend the life span and to improve the quality of life.Trial registration: ChiCTR, ChiCTR1800015942. Registered 1 May 2018, http://www.chictr.org.cn/showproj.aspx?proj=26476