HtrA serine peptidase 3 (HTRA3) participates in multiple signal pathways and plays an important regulatory role in various malignancies; however, its role on prognosis and immune infiltrates in gastric cancer (GC) remains unclear. The study investigated HTRA3 expression in tumor tissues and its association with immune infiltrates, and determined its prognostic roles in GC patients. Patients with GC were collected from the cancer genome atlas (TCGA). We compared the expression of HTRA3 in GC and normal gastric mucosa tissues with Wilcoxon rank sum test. And logistic regression was used to evaluate the relationship between HTRA3 and clinicopathological characters. Gene ontology (GO) term analysis, Gene set enrichment analysis (GSEA), and single-sample Gene Set Enrichment Analysis (ssGSEA) was conducted to explain the enrichmental pathways and functions and quantify the extent of immune cells infiltration for HTRA3. Kaplan-Meier analysis and Cox regression were performed to evaluate the correlation between HTRA3 and survival rates. A nomogram, based on Cox multivariate analysis, was used to predict the impact of HTRA3 on prognosis. High HTRA3 expression was significantly correlated with tumor histological type, histological grade, clinical stage, T stage, and TP53 status (P < 0.05). HTRA3-high GC patients had a lower 10-year progression-free interval [PFI; hazard ratio (HR): 1.46; 95% confidence interval (CI): 1.02–2.08; P = 0.038], disease-specific survival (DSS; HR: 1.65; CI: 1.08–2.52; P = 0.021) and overall survival (OS; HR: 1.59; CI: 1.14–2.22; P = 0.006). Multivariate survival analysis showed that HTRA3 was an independent prognostic marker for PFI (HR: 1.456; CI: 1.021–2.078; P = 0.038), DSS (HR: 1.650; CI: 1.079–2.522; P = 0.021) and OS [hazard ratio (HR): 1.590; 95% confidence interval (CI):1.140–2.219; P = 0.006]. The C-indexes and calibration plots of the nomogram based on multivariate analysis indicated an effective predictive performance for GC patients. GSEA showed that High HTRA3 expression may activate NF-κB pathway, YAP1/WWTR1/TAZ pathway, and TGFβ pathway. There was a negative correlation between the HTRA3 expression and the abundances of adaptive immunocytes (T helper cell 17 cells) and a positive correlation with abundances of innate immunocytes (natural killer cells, macrophages etc.). HTRA3 plays a vital role in GC progression and prognosis and could be a moderate biomarker for prediction for survival after gastrectomy.