Background: The immunotherapy efficacy in gastric cancer (GC) is limited. Cancer-associated fibroblasts (CAFs) induce primary resistance to immunotherapy. However, CAF infiltration in tumors is difficult to evaluate due to the lack of validated and standardized quantified methods. This study aimed to investigate the impact of infiltrating CAFs alternatively using fibroblast-associated mutation scoring (FAMscore).Methods: In a GC cohort from Affiliated Hospital of Jiangsu University (AHJU), whole exon sequencing of genomic mutations, whole transcriptome sequencing of mRNA expression profiles, and immunofluorescence staining of tumor-infiltrating immune cells were performed. GC data from The Cancer Genome Atlas were used to identify genetic mutations which were associated with overall survival (OS) and impacted infiltrating CAF abundance determined by transcriptome-based estimation. FAMscore was then constructed through a least absolute shrinkage and selection operator Cox regression model and further validated in AHJU. The predictive role of FAMscore for immunotherapy outcomes was tested in 1 GC, one melanoma, and two non-small-cell lung cancer (NSCLC-1 and -2) cohorts wherein participants were treated by immune checkpoint inhibitors.Results: FAMscore was calculated based on a mutation signature consisting of 16 genes. In both TCGA and AHJU, a high FAMscore was an independent predictor for poor OS of GC patients. FAMscore was associated with immune-associated genome biomarkers, immune cell infiltration, and signaling pathways of abnormal immunity. Importantly, patients with high FAMscore presented inferiority in the objective response rate of immunotherapy compared to those with low FAMscore, with 14.6% vs. 66.7% (p<0.001) in GC, 19.6% vs. 68.2% (p<0.001) in NSCLC-1, 23.1% vs 75% (p = 0.007) in NSCLC-2, and 40.9% vs 75% (p = 0.037) in melanoma. For available survival data, a high FAMscore was also an independent predictor of poor progression-free survival in NSCLC-1 (HR = 2.55, 95% CI: 1.16–5.62, p = 0.02) and NSCLC-2 (HR = 5.0, 95% CI: 1.13–22.19, p = 0.034) and poor OS in melanoma (HR = 3.48, 95% CI: 1.27–9.55, p = 0.015).Conclusions: Alternative evaluation of CAF infiltration in GC by determining the FAMscore could independently predict prognosis and immunotherapy outcomes. The FAMscore may be used to optimize patient selection for immunotherapy.