Ovarian cancer (OC) is a frequently lethal gynecologic malignancy, characterized by a poor prognosis and high recurrence rate. The immune microenvironment has been implicated in the progression of OC. We characterized the immune landscape in primary and malignant OC ascites using single-cell and bulk transcriptome raw OC data acquired from the Gene Expression Omnibus and The Cancer Genome Atlas databases. We then used the CIBERSORT deconvolution algorithm, weighted gene co-expression network analysis, univariate and multivariate Cox analyses, and the LASSO algorithm to develop a tumor-associated macrophage-related gene (TAMRG) prognostic signature, which enabled us to stratify and predict overall survival (OS) of OC patients. In addition, inter- and intra-patient heterogeneity of infiltrating immune cells was characterized at single-cell resolution. Tumor-infiltrating macrophages with an M2 phenotype exhibited immunosuppressive activity. M1 macrophages positively correlated with OS, whereas activated mast cells, neutrophils, M2 macrophages, and activated memory CD4+ T cells were all negatively correlated with OS. A total of 219 TAMRGs were identified, and a novel 6-gene signature (TAP1, CD163, VSIG4, IGKV4-1, CD3E, and MS4A7) with independent prognostic value was established. These results show that a TAMRG-based signature may be a promising prognostic and therapeutic target in OC.