Abstract Background. The prognosis for prostate cancer patients remains poor. High-throughput sequencing data provide a solid basis for identifying genes associated with cancer prognosis, but genetic markers are needed to predict the clinical outcome of prostate cancer. Methods. The Cancer Genome Atlas (TCGA) database (N = 551) was adopted to estimate the prognostic value of immune genes. RNA-seq and clinical follow-up data were downloaded from TCGA. The samples were randomly divided into training and test. Cox regression analyses and least absolute shrinkage and selection operator (LASSO) were conducted to develop an immune risk score. Gene Ontology (GO), Kyoto Encyclopedia of Genes and Genomes (KEGG) and single sample Gene Set Enrichment Analysis (ssGSEA) were used for functional Analysis. Tumor Immune Estimation Resource (TIMER) is used to analyze the immune score, and RMS curve and clinical decision curve analysis is used to analyze the superiority of the comparison with published models. Results. Survival analyses revealed that 19 genes significantly associated with the overall survival (OS). 10-genes signature was ultimately obtained through random forest feature selection. Riskscore effectively stratified samples in the training, test, and external verification sets and all TCGA sets. The 5-year survival AUC in the training, verification sets and all TCGA sets were around 0.7. Univariate and multivariate analysis showed that 10-genes signature has good predictive performance in clinical. TIMER analysis shows that immunosuppression may reduce the chances of survival for patients with prostate cancer. Compared with published models, our model has a higher C-index. Conclusion. We constructed a 10-gene signature as a new prognostic marker for predicting survival of prostate cancer patients.