Artemether-lumefantrine (AL) is the most widely-recommended treatment for uncomplicated Plasmodium falciparum malaria worldwide. Its safety and efficacy have been extensively demonstrated in clinical trials; however, its performance in routine health care settings, where adherence to drug treatment is unsupervised and therefore may be suboptimal, is less well characterised. Here we develop a within-host modelling framework for estimating the effects of sub-optimal adherence to AL treatment on clinical outcomes in malaria patients. Our model incorporates the data on the human immune response to the parasite, and AL's pharmacokinetic and pharmacodynamic properties. Utilising individual-level data of adherence to AL in 482 Tanzanian patients as input for our model predicted higher rates of treatment failure than were obtained when adherence was optimal (9% compared to 4%). Our model estimates that the impact of imperfect adherence was worst in children, highlighting the importance of advice to caregivers.