Hepatocellular carcinoma (HCC) is one of the most common malignant tumors originating from the digestive system. Tertiary lymphoid structures (TLS), non-lymphoid tissues outside of the lymphoid organs, are closely connected to chronic inflammation and tumorigenesis. However, the detailed relationship between TLS and HCC prognosis remained unclear. In this study, we aimed to construct a TLS-related gene signature for predicting the prognosis of HCC patients. The Cancer Genome Atlas (TCGA) clinical data from 369 HCC tissues and 50 normal liver tissues were utilized to examine the differential expression of TLS-related genes. Based on least absolute shrinkage and selection operator (LASSO) Cox regression analysis, the prognostic model was constructed using the TCGA cohort and validated in the GSE14520 cohort and International Cancer Genome Consortium (ICGC) cohort. The Kaplan-Meier (KM) and receiver operating characteristic (ROC) curves were employed to validate the predictive ability of the prognostic model. Furthermore, Cox regression analysis was applied to identify whether the TLS score could be employed as an independent prognosis factor. A nomogram was developed to predict the survival probability of HCC patients. Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathways were performed for TLS-related genes. Genetic mutation analysis, the CIBERSORT algorithm, and single-sample gene set enrichment analysis (ssGSEA) were used to assess the tumor mutation landscape and immune infiltration. Finally, the role of the TLS score in HCC therapy was investigated. Six genes were included in the construction of our prognostic model (CETP, DNASE1L3, PLAC8, SKAP1, C7, and VNN2), and we validated its accuracy. Survival analysis showed that patients in the high-TLS score group had a significantly better overall survival than those in the low-TLS score group. Univariate, multivariate Cox regression analysis and the establishment of a nomogram indicated that the TLS score could independently function as a potential prognostic marker. A significant association between TLS score and immunity was revealed by an analysis of gene alterations and immune cell infiltration. In addition, two subtypes of the TLS score could accurately predict the effectiveness of sorafenib, transcatheter arterial chemoembolization (TACE), and immunotherapy in HCC patients. In this research, we conducted and validated a prognostic model associated with TLS that may be helpful for predicting clinical outcomes and treatment responsiveness for HCC patients.