Antitumor therapy has now entered the era of immunotherapy represented by programmed cell death protein-1 (PD-1) inhibitors, but predicting the prognosis of immunotherapy for pancreatic cancer (PC) remains challenging. The aim of this study was to evaluate the factors influencing the prognosis of PC patients who had received PD-1 inhibitor therapy. This study was a single-center, retrospective, observational study that was approved by the Ethics Committee of the General Hospital of the People's Liberation Army (Approval number S2021-228-03). We reviewed the medical records of patients with advanced PC treated with PD-1 inhibitors in the Department of Oncology of the PLA General Hospital between September 2015 and September 2022. Data from 126 patients were evaluated using Kaplan-Meier analysis and Cox proportional risk model analysis. p<0.05 was considered a statistically significant difference. The median overall survival (mOS) and median progression-free survival (mPFS) of 126 patients with advanced PC treated with PD-1 inhibitors were 12.1 months and 4.6 months, respectively. Independent predictors of significantly prolonged patient mOS were history of surgery (44.2 months vs. 10 months, p=0.022), absence of liver metastases (44.2 months vs. 6.4 months, p=0.034), and baseline CA19 -9 level ≤216.15 U/ml (18.5 months vs. 9.2 months, p=0.049). Independent predictors that significantly prolonged patients' mPFS were histologically intermediate/highly differentiated (5.5 vs. 3.2 months, p=0.022) and the use of PD-1 inhibitors at first-line treatment (5.1 vs. 1.5 months, p=0.001). Subgroup analyses found that low histologic differentiation was associated with earlier disease progression, and no history of surgery was associated with earlier patient death. This study suggests that history of surgery, absence of liver metastases, baseline CA19-9 level, and histologic intermediate/high differentiation can be used as a composite predictor of the efficacy of PD-1 inhibitors in patients with advanced pancreatic cancer. However, further prospective clinical trials are needed for validation.