There is a lack of effective programmed cell death protein 1 (PD-1)‐targeted immunotherapy with good tolerability in patients with advanced hepatocellular carcinoma (HCC) and severely compromised liver function. We assessed patient outcomes after combined camrelizumab and molecular targeted therapy in a multicenter cohort study in China. The study included 99 patients with advanced HCC (58 Child-Pugh A and 41 Child-Pugh B), 84 of them received camrelizumab combined with molecular targeted therapy from January 10, 2019, to March 31, 2021. Overall survival (OS), progression-free survival (PFS), objective response rate (ORR), disease control rate (DCR), and adverse events (AEs) were assessed. The median follow-up was 12.1 months. For patients with Child-Pugh B, the OS probability at 12-months, ORR and DCR were 49.7%, 31.7% and 65.9%, respectively, and the median PFS was 5.1 months [95% confidence interval (CI) 3.0–7.1], which were comparable with Child-Pugh A patients, although median OS was shorter in Child‐Pugh B patients (20.5 vs.13.4 months,P= 0.12). In multivariate analysis, macrovascular infiltration (MVI), but not sex, age, hepatitis B virus etiology, extrahepatic metastasis, Child-Pugh B, or AFP > 400 ng/ml, was associated with 12-months OS [hazard ratio (HR) 2.970, 95% CI 1.276–6.917,P= 0.012] and ORR (HR 2.906, 95% CI 1.18–7.16,P= 0.020). Grade 3/4 immune-related AEs occurred in 26.8% of Child-Pugh B patients, including one potentially treatment-related death. In both groups, the most common AEs were immune thrombocytopenia and hepatotoxicity. Camrelizumab combined with targeted therapy showed favorable effectiveness and tolerability with manageable toxicities in Chinese HCC patients, regardless of Child-Pugh A/B liver function. MVI was associated with suboptimal immunotherapy response and poor prognosis.Graphical abstractSupplementary InformationThe online version contains supplementary material available at 10.1007/s00262-023-03404-8.