Sulfadoxine-pyrimethamine (SP), despite the emergence and spread of mutations in dhfr and dhps genes associated with lower treatment efficacy, is still recommended alone or in combination by the WHO for preventive treatment in pregnant women, children and infants. Therefore, it is important to understand the evolution of P. falciparum dhfr and dhps genes. Here, we used a subset of the MalariaGEN Pf7 dataset to describe haplotype frequencies across 22 African countries, including changes over time in The Gambia, Mali, Ghana and Kenya. We show that the triple mutant of dhfr, N51I/C59R/S108N, has remained the dominant haplotype across the continent with limited evidence of additional mutations. There is greater variation for dhps, with a total of 51 different haplotypes present. The dhps resistance mutation A437G has risen close to fixation across most of Africa, although at a lower frequency in the northwest malaria-endemic part of the continent (Gambia, Senegal and Mali). The A437G mutation is usually found together with K540E in East Africa, but K540E is still very rare in West Africa. Although samples from Madagascar have low genetic differentiation from samples from mainland East Africa at the whole genome level, we show that dhps K540E is highly differentiated between the two populations, being at very low frequency in Madagascar (4%). We used whole genome data to show that only 12 SNPs are more highly differentiated than K540E between Madagascar and East Africa, with aat1 and a possible novel drug resistance locus approximately 20kb 3' of mdr1 having even higher FST. We highlight the value of longitudinal sampling and whole genome sequence data for understanding the heterogeneity and ongoing changes in anti-malarial drug resistance genetic markers.