Inflammation can support or restrain cancer progression and the response to therapy. Here, we searched for primary regulators of cancer-inhibitory inflammation through deep profiling of inflammatory tumor microenvironments (TMEs) linked to immune-dependent control in mice. We found that early intratumoral accumulation of interferon gamma (IFN-γ)-producing natural killer (NK) cells induced a profound remodeling of the TME and unleashed cytotoxic T cell (CTL)-mediated tumor eradication. Mechanistically, tumor-derived prostaglandin E2 (PGE2) acted selectively on EP2 and EP4 receptors on NK cells, hampered the TME switch, and enabled immune evasion. Analysis of patient datasets across human cancers revealed distinct inflammatory TME phenotypes resembling those associated with cancer immune control versus escape in mice. This allowed us to generate a gene-expression signature that integrated opposing inflammatory factors and predicted patient survival and response to immune checkpoint blockade. Our findings identify features of the tumor inflammatory milieu associated with immune control of cancer and establish a strategy to predict immunotherapy outcomes.