Anti-hepatitis B virus (HBV) drugs are currently limited to nucleos(t)ide analogs (NAs) and interferons. A challenge of drug development is the identification of small molecules that suppress HBV infection from new chemical sources. Here, from a fungus-derived secondary metabolite library, we identify a structurally novel tricyclic polyketide, named vanitaracin A, which specifically inhibits HBV infection. Vanitaracin A inhibited the viral entry process with a submicromolar 50% inhibitory concentration (IC50) (IC50 = 0.61 ± 0.23 μM), without evident cytotoxicity (50% cytotoxic concentration of >256 μM; selectivity index value of >419) in primary human hepatocytes. Vanitaracin A did not affect the HBV replication process. This compound was found to directly interact with the HBV entry receptor sodium taurocholate cotransporting polypeptide (NTCP) and impaired its bile acid transport activity. Consistent with this NTCP targeting, antiviral activity of vanitaracin A was observed with hepatitis D virus (HDV) but not hepatitis C virus. Importantly, vanitaracin A inhibited infection by all HBV genotypes tested (genotypes A to D) and clinically relevant NA-resistant HBV isolate. Thus, we identified a fungal metabolite, vanitaracin A, which was a potent, well-tolerated, and broadly active inhibitor of HBV and HDV entry. This compound, or its related analogs, could be part of an antiviral strategy for preventing reinfection with HBV, including clinically relevant nucleos(t)ide analog-resistant virus.