Nasopharyngeal carcinoma (NPC) recurrence, distant metastasis, and drug resistance remain significant obstacles in clinical prognosis. Cancer stemness is hypothesized to be a key contributor, though direct evidence is sparse. We utilized bioinformatics and machine learning techniques on single-cell RNA-seq and bulk transcriptomic datasets, complemented by basic experiments, to investigate stemness-based characteristics in NPC. Our analysis identified two potential developmental trajectories of nasopharyngeal cancer cells, each exhibiting varying levels of stemness. We subsequently identified and validated a cancer stemness-related signature (STEM-signature). Single-cell profiling revealed enrichment of LAYN + CD8 + , CTLA4 + CD4 + , CXCL13 + CD4 + T cells, tumor-associated macrophages, and CD14 + monocytes in NPC patients with high stemness. NicheNet analysis suggested these immune cells regulate cancer stemness. Bulk transcriptomic analysis corroborated these findings, indicating a poor therapeutic response in high-stemness NPC. We predicted 13 potential drugs and identified 13 stemness-related miRNAs for NPC with high stemness. A Least Absolute Shrinkage and Selection Operator (LASSO) Cox regression model, based on this miRNA signature, predicted overall survival with an AUC of 0.71 and 0.72 in validation and testing sets, respectively. The miRNA-based stemness signature outperformed previous established signatures. Multivariate Cox regression analysis indicated that our prognostic signature could serve as an independent prognostic factor (p < 0.001). Basic experiments showed that miR-300, miR-361-5p, miR-1246, and miR-1290 enhanced the stemness characteristics of NPC cells, promoting proliferation, invasion, and migration. These findings suggest that these four stemness-related miRNAs could serve as therapeutic targets, potentially improving therapeutic responses by targeting stemness-related genes.