Background: Ovarian cancer is highly malignant and has a poor prognosis in the advanced stage. Studies have shown that infiltration of tumor microenvironment cells, immune cells and stromal cells has an important impact on the prognosis of cancers. However, the relationship between tumor microenvironment genes and the prognosis of ovarian cancer has not been studied.Methods: Gene expression profiles and SNP data of ovarian cancer were downloaded from the TCGA database. Cluster analysis, WGCNA analysis and univariate survival analysis were used to identify immune microenvironment genes as prognostic signatures for predicting the survival of ovarian cancer patients. External data were used to evaluate the signature. Moreover, the top five significantly correlated genes were evaluated by immunohistochemical staining of ovarian cancer tissues.Results: We systematically analyzed the relationship between ovarian cancer and immune metagenes. Immune metagenes expression were associated with prognosis. In total, we identified 10 genes related to both immunity and prognosis in ovarian cancer according to the expression of immune metagenes. These data reveal that high expression of ETV7 (OS, HR = 1.540, 95% CI 1.023–2.390, p = 0.041), GBP4 (OS, HR = 1.834, 95% CI 1.242–3.055, p = 0.004), CXCL9 (OS, HR = 1.613, 95% CI 1.080 –2.471, p = 0.021), CD3E (OS, HR = 1.590, 95% CI 1.049 –2.459, p = 0.031), and TAP1 (OS, HR = 1.766, 95% CI 1.163 –2.723, p = 0.009) are associated with better prognosis in patients with ovarian cancer.Conclusion: Our study identified 10 immune microenvironment genes related to the prognosis of ovarian cancer. The list of tumor microenvironment-related genes provides new insights into the underlying biological mechanisms driving the tumorigenesis of ovarian cancer.