Anti-PD-1 monoclonal antibodies have shown durable long-term survival benefit in patients with metastatic melanoma. Limited evidence exists on the safety and efficacy of PD-1 inhibitors in patients with hepatitis B virus (HBV) and hepatitis C virus (HCV) infections as these patients have traditionally been excluded from clinical trials because of a theoretical risk of immune reconstitution inflammatory syndrome. We aim to determine the safety and efficacy of treatment with PD-1 inhibitors in seven patients with HBV/HCV infection and concurrent metastatic melanoma or non-small-cell lung cancer (NSCLC). We describe seven patients treated with PD-1 inhibitors nivolumab and pembrolizumab for either metastatic melanoma or metastatic NSCLC in the setting of chronic or past HBV/HCV infection. The safety and efficacy of treatment were analysed retrospectively by examining response to treatment, alanine transaminase (ALT) trends and viral load trends. One patient showed an increase in ALT of Common Terminology Criteria for Adverse Events (CTCAE) grade 2 severity that returned to the normal range following treatment of his HCV infection with ledipasvir 90 mg/sofosbuvir 400 mg. An additional four patients showed an increase in ALT of CTCAE grade 1 severity. The remaining two patients experienced no hepatic toxicity, with stable disease continuing after more than 24 cycles of nivolumab. Efficacy was similar to the data of published trials. Our results indicate that patients with metastatic melanoma and NSCLC can be treated safely with PD-1 inhibitors in the context of HBV/HCV infection. However, we recommend that those with active viral hepatitis be monitored closely in consultation with a hepatologist and treated with antiviral therapy if indicated.