The emergence and spread of drug-resistant Plasmodium falciparum impedes global efforts to control and eliminate malaria. For decades, treatment of malaria has relied on chloroquine (CQ), a safe and affordable 4-aminoquinoline that was highly effective against intra-erythrocytic asexual blood-stage parasites, until resistance arose in Southeast Asia and South America and spread worldwide1. Clinical resistance to the chemically related current first-line combination drug piperaquine (PPQ) has now emerged regionally, reducing its efficacy2. Resistance to CQ and PPQ has been associated with distinct sets of point mutations in the P. falciparum CQ-resistance transporter PfCRT, a 49-kDa member of the drug/metabolite transporter superfamily that traverses the membrane of the acidic digestive vacuole of the parasite3-9. Here we present the structure, at 3.2 Å resolution, of the PfCRT isoform of CQ-resistant, PPQ-sensitive South American 7G8 parasites, using single-particle cryo-electron microscopy and antigen-binding fragment technology. Mutations that contribute to CQ and PPQ resistance localize primarily to moderately conserved sites on distinct helices that line a central negatively charged cavity, indicating that this cavity is the principal site of interaction with the positively charged CQ and PPQ. Binding and transport studies reveal that the 7G8 isoform binds both drugs with comparable affinities, and that these drugs are mutually competitive. The 7G8 isoform transports CQ in a membrane potential- and pH-dependent manner, consistent with an active efflux mechanism that drives CQ resistance5, but does not transport PPQ. Functional studies on the newly emerging PfCRT F145I and C350R mutations, associated with decreased PPQ susceptibility in Asia and South America, respectively6,9, reveal their ability to mediate PPQ transport in 7G8 variant proteins and to confer resistance in gene-edited parasites. Structural, functional and in silico analyses suggest that distinct mechanistic features mediate the resistance to CQ and PPQ in PfCRT variants. These data provide atomic-level insights into the molecular mechanism of this key mediator of antimalarial treatment failures.