BackgroundWhile recent studies have separately explored mutational signatures and the tumor microenvironment (TME), there is limited research on the associations of both factors in a pan-cancer context.Materials and methodsWe performed a pan-cancer analysis of over 8,000 tumor samples from The Cancer Genome Atlas (TCGA) project. Machine learning methods were employed to systematically explore the relationship between mutational signatures and TME and develop a risk score based on TME-associated mutational signatures to predict patient survival outcomes. We also constructed an interaction model to explore how mutational signatures and TME interact and influence cancer prognosis.ResultsOur analysis revealed a varied association between mutational signatures and TME, with the Clock-like signature showing the most widespread influence. Risk scores based on mutational signatures mainly induced by Clock-like and AID/APOBEC activity exhibited strong pan-cancer survival stratification ability. We also propose a novel approach to predict transcriptome decomposed infiltration levels using genome-derived mutational signatures as an alternative approach for exploring TME cell types when transcriptome data are unavailable. Our comprehensive analysis revealed that certain mutational signatures and their interaction with immune cells significantly impact clinical outcomes in particular cancer types. For instance, T cell infiltration levels only served as a prognostic biomarker in melanoma patients with high ultraviolet radiation exposure, breast cancer patients with high homologous recombination deficiency signature, and lung adenocarcinoma patients with high tobacco-associated mutational signature.ConclusionOur study comprehensively explains the complex interplay between mutational signatures and immune infiltration in cancer. The results highlight the importance of considering both mutational signatures and immune phenotypes in cancer research and their significant implications for developing personalized cancer treatments and more effective immunotherapy.