Mass drug administration (MDA) with antimalarials has been shown to reduce prevalence and interrupt transmission in small populations, in populations with reliable access to antimalarial drugs, and in populations where sustained improvements in diagnosis and treatment are possible. In addition, when MDA is effective it eliminates both drug-resistant parasites and drug-sensitive parasites, which has the long-term benefit of extending the useful therapeutic life of first-line therapies for all populations, not just the focal population where MDA was carried out. However, in order to plan elimination measures effectively, it is necessary to characterize the conditions under which failed MDA could exacerbate resistance. We use an individual-based stochastic model of Plasmodium falciparum transmission to evaluate this risk for MDA using dihydroartemisinin-piperaquine (DHA-PPQ), in populations where access to antimalarial treatments may not be uniformly high and where re-importation of drug-resistant parasites may be common. We find that artemisinin-resistance evolution at the kelch13 locus can be accelerated by MDA when all three of the following conditions are met: (1) strong genetic bottlenecking that falls short of elimination, (2) re-importation of artemisinin-resistant genotypes, and (3) continued selection pressure during routine case management post-MDA. Accelerated resistance levels are not immediate but follow the rebound of malaria cases post-MDA, if this is allowed to occur. Crucially, resistance is driven by the selection pressure during routine case management post-MDA and not the selection pressure exerted during the MDA itself. Second, we find that increasing treatment coverage post-MDA increases the probability of local elimination in low-transmission regions (prevalence < 2%) in scenarios with both low and high levels of drug-resistance importation. This emphasizes the importance of planning for and supporting high coverage of diagnosis and treatment post-MDA.