The existence of intratumoral tertiary lymphoid structure (iTLS) has been reported to correlative with favorable clinical outcomes for patients with hepatocellular carcinoma (HCC). However, little is known about the role of peritumoral TLS (pTLS). This study aimed to investigate the prognostic role of pTLS either alone or jointly with iTLS and the potential association with local immune response in HCC. The formation and cellular composition of TLS was evaluated by hematoxylin & eosin and immunohistochemistry. Evaluation of tumor-infiltrating immune cells and formation of germinal center (GC) inside TLS was performed by immunohistochemistry. The gene expression profiles were analyzed by real-time PCR. In a total of 360 patients from two independent cohorts, the pTLS was identified in most, whereas iTLS could be observed in only approximately 30% of HCC specimens. Patients with high pTLS densities were associated with improved outcomes, those present with characteristic morphology of GC, particularly, showing an even better prognosis. The combination of pTLS and iTLS allowed the identification of patients with best prognosis. Tumors with high pTLS density showed significantly increased expression of Th1-, Th17- and immune suppression-related genes, as well as significantly higher infiltration of CD3+, CD8+ and CD20+ cells and lower infiltration of FOXP3+, CD68+ and PD1+ cells. Conclusively, we provide evidence that pTLS is associated with intratumoral immune infiltration, highlighting the dynamic interplay between pTLS and immune cells recruitment. High pTLS density links to a tumor microenvironment with an active immune reaction and improved patient survival and represents a promising prognostic biomarker for HCC.