Sorafenib, the first targeted therapy for hepatocellular carcinoma (HCC), has been utilized in clinics over a decade. However, its effectiveness is severely hindered by the acquired drug resistance, the mechanisms of which remain largely elusive. In this study, we identify that carbonic anhydrase 2 (CA2) is a key regulator of sorafenib resistance. Mechanistically, sorafenib treatment decreases intracellular pH (pHi) by suppressing monocarboxylate transporter 4 (MCT4) expression, while high levels of CA2 counteract MCT4-mediated pHi dysregulation upon sorafenib treatment, maintaining pHi homeostasis to facilitate cell survival and sorafenib resistance. Targeting CA2 re-sensitizes resistant HCC cells to sorafenib both in vitro and in vivo. Importantly, analysis of clinical samples demonstrates a strong correlation between CA2 expression levels and the therapeutic efficacy of sorafenib in HCC patients. Our findings highlight the significance of CA2 in facilitating sorafenib resistance and propose targeting CA2 as a potential strategy for overcoming sorafenib resistance in HCC patients.