ABCB4 is an ATP-binding cassette transporter that extrudes phosphatidylcholine into the bile canaliculi of the liver. Its dysfunction or inhibition by drugs can cause severe, chronic liver disease or drug-induced liver injury. We determined the cryo-EM structure of nanodisc-reconstituted human ABCB4 trapped in an ATP-bound state at a resolution of 3.2 Å. The nucleotide binding domains form a closed conformation containing two bound ATP molecules, but only one of the ATPase sites contains bound Mg2+. The transmembrane domains adopt a collapsed conformation at the level of the lipid bilayer, but we observed a large, hydrophilic and fully occluded cavity at the level of the cytoplasmic membrane boundary, with no ligand bound. This indicates a state following substrate release but prior to ATP hydrolysis. Our results rationalize disease-causing mutations in human ABCB4 and suggest an 'alternating access' mechanism of lipid extrusion, distinct from the 'credit card swipe' model of other lipid transporters.