The MacA-MacB-TolC assembly of Escherichia coli is a transmembrane machine that spans the cell envelope and actively extrudes substrates, including macrolide antibiotics and polypeptide virulence factors. These transport processes are energized by the ATPase MacB, a member of the ATP-binding cassette (ABC) superfamily. We present an electron cryo-microscopy structure of the ABC-type tripartite assembly at near-atomic resolution. A hexamer of the periplasmic protein MacA bridges between a TolC trimer in the outer membrane and a MacB dimer in the inner membrane, generating a quaternary structure with a central channel for substrate translocation. A gating ring found in MacA is proposed to act as a one-way valve in substrate transport. The MacB structure features an atypical transmembrane domain with a closely packed dimer interface and a periplasmic opening that is the likely portal for substrate entry from the periplasm, with subsequent displacement through an allosteric transport mechanism.This work was supported by the Wellcome Trust (B.F.L.), HFSP (B.F.L., H.W.v.V., S. M.), Marie Curie International Outgoing Fellowship (A.W.P.F.), the UK Medical Research Council (MC_UP_A025_1013, to SHWS), Wellcome Trust ISSF award (grant number: WT097818MF), the Scottish Universities’ Physics Alliance (U.Z. and S.L.) and MRC Mitochondrial Biology Unit (Grant number: U105663141). A.N. is the recipient of a Herchel-Smith Scholarship