Objective:To analyze the effect of psychological intervention on the nursing effect and sleep quality of elderly patients with gastric cancer.Methods:A total of 80 elderly patients with gastric cancer admitted to the Department of General Surgery of the First Affiliated Hospital of Xiamen University from January 2022 to January 2023 were selected as research objects and divid-ed into control group and observation group according to random number table method,with 40 cases in each group.The control group was given routine nursing intervention,and the observation group was given psychological nursing intervention on the basis of the control group.Pittsburgh Sleep Quality Index(PSQI)was used to compare the difference in sleep quality between the two groups,self-rating anxiety scale(SAS)and self-rating Depression Scale(SDS)were used to compare the improvement of anxiety and depression symptoms between the two groups,and visual analog scale(VAS)was used to compare the improvement of pain between the two groups before and after intervention.Results:After intervention,PSQI score,SAS score,SDS score and VAS score in the observation group were significantly lower than those in the control group,and the difference between the two groups was statistically significant(P<0.05).Conclusion:The clinical effect of psychological intervention in elderly patients with gastric cancer is significant,the pain degree of patients is reduced,the depression and anxiety are reduced,and the sleep quality is im-proved,which is conducive to the recovery of the patients.