The three-gene APL1 locus encodes essential components of the mosquito immune defense against malaria parasites. APL1 was originally identified because it lies within a mapped QTL conferring the vector mosquito Anopheles gambiae natural resistance to the human malaria parasite, Plasmodium falciparum, and APL1 genes have subsequently been shown to be involved in defense against several species of Plasmodium. Here, we examine molecular population genetic variation at the APL1 gene cluster in spatially and temporally diverse West African collections of A. gambiae. The locus is extremely polymorphic, showing evidence of adaptive evolutionary maintenance of genetic variation. We hypothesize that this variability aids in defense against genetically diverse pathogens, including Plasmodium. Variation at APL1 is highly structured across geographic and temporal subpopulations. In particular, diversity is exceptionally high during the rainy season, when malaria transmission rates are at their peak. Much less allelic diversity is observed during the dry season when mosquito population sizes and malaria transmission rates are low. APL1 diversity is weakly stratified by the polymorphic 2La chromosomal inversion but is very strongly subdivided between the M and S "molecular forms." We find evidence that a recent selective sweep has occurred at the APL1 locus in M form mosquitoes only. The independently reported observation of a similar M-form restricted sweep at the Tep1 locus, whose product physically interacts with APL1C, suggests that epistatic selection may act on these two loci causing them to sweep coordinately.