Drug-induced liver injury (DILI) is an important cause of serious liver disease. The antimicrobial agent flucloxacillin is a common cause of DILI, but the genetic basis for susceptibility remains unclear. We conducted a genome-wide association (GWA) study using 866,399 markers in 51 cases of flucloxacillin DILI and 282 controls matched for sex and ancestry. The GWA showed an association peak in the major histocompatibility complex (MHC) region with the strongest association (P = 8.7 × 10 -33) seen for rs2395029[G], a marker in complete linkage disequilibrium (LD) with HLA-B*5701. Further MHC genotyping, which included 64 flucloxacillin-tolerant controls, confirmed the association with HLA-B5701 (OR = 80.6, P = 9.0 × 10 -19). The association was replicated in a second cohort of 23 cases. In HLA-B*5701 carrier cases, rs10937275 in ST6GAL1 on chromosome 3 also showed genome-wide significance (OR = 4.1, P = 1.4 × 10 -8). These findings provide new insights into the mechanism of flucloxacillin DILI and have the potential to substantially improve diagnosis of this serious disease.