Anopheles gambiae, the major vector of human malaria parasite, is an important insect model to study vector–parasite interactions. Here, we developed a simple in vivo double-stranded RNA (dsRNA) knockout approach to determine the function of the mosquito antimicrobial peptide gene Defensin. We injected dsRNA into adults and observed efficient and reproducible silencing of Defensin. Analysis of the knockdown phenotype revealed that this peptide is required for the mosquito antimicrobial defense against Gram-positive bacteria. In contrast, in mosquitoes infected by Plasmodium berghei, no loss of mosquito viability and no significant effect on the development and morphology of the parasite midgut stages were observed in the absence of Defensin. We conclude that this peptide is not a major antiparasitic factor in A. gambiae in vivo. Our results open new perspectives for the study of mosquito gene function in vivo and provide a basis for genome-scale systematic functional screens by targeted gene silencing.