Background: A limited number of studies have characterized genomic properties of hepatocellular carcinoma (HCC) patients in response to anti-PD-1 immunotherapy. Methods: Herein, we performed comprehensive molecular characterization of immediate (D-42 to D-1) pre-treatment tumor biopsy specimens from 60 patients with sorafenib-failed HCC in a single-arm prospective phase II trial of pembrolizumab. Objective response rate was the primary efficacy endpoint. We used whole-exome sequencing, RNA sequencing, and correlative analysis. In addition, we performed single-cell RNA sequencing using peripheral blood mononuclear cells. Results: The overall response rate of pembrolizumab in sorafenib-failed HCC patients was 10% ([6/60] 95% CI, 2.4–17.6). In a univariate analysis using clinicopathological features, female gender, PD-L1 positivity, and low neutrophil-to-lymphocyte ratio (NLR) were identified as contributing factors to pembrolizumab response. Somatic mutations in CTNNB1 and genomic amplifications in MET were found only in non-responders. Transcriptional profiles through RNA sequencing identified that pembrolizumab responders demonstrated T cell receptor (TCR) signaling activation with expressions of MHC genes, indicating increased levels of T cell cytotoxicity. In single-cell sequencing from 10 pre- and post-treatment peripheral blood mononuclear cells (PBMCs), patients who achieved a partial response or stable disease exhibited immunological shifts toward cytotoxic CD8+ T cells. Conversely, patients with progressive disease showed an increased number of both CD14+ and CD16+ monocytes and activation of neutrophil-associated pathways. Conclusions: Taken together, HCC patients with infiltration of cytotoxic T cells, along with increased active circulating CD8+ T cells during pembrolizumab treatment and down-regulation of neutrophil-associated markers, significantly benefited from pembrolizumab treatment. Trial registration: NCT#03163992 (first posted: May 23, 2017).