Cecropins and defensins are important antimicrobial peptides in insects and are inducible after injection of immune triggers. In this study, we cloned the cDNAs of two antimicrobial peptides (AMPs), cecropin-2 (BdCec-2) and defensin (BdDef) from Bactrocera dorsalis (Hendel), a serious pest causing great economic losses to fruits and vegetables. The BdCec-2 sequence of 192bp encodes a protein of 63 amino acids residues with a predicted molecular weight of 6.78kD. The 282bp cDNA of BdDef encodes a protein of 93 residues with a predicted molecular weight of 9.81kD. Quantitative real-time PCR analyses showed that BdCec-2 and BdDef had similar expression profiles among development stages, the highest mRNA levels of these two AMP genes were observed in the adult stage. Among different adult body segments and tissues, both genes had similar transcriptional profiles, the highest mRNA levels appeared in abdomen and fat body, which was consistent with the reported fact that fat body was the main organ synthesizing AMPs in insects. The expression of BdCec-2 and BdDef were up-regulated after challenge with peptidoglycans from Escherichia coli (PGN-EB) and Staphylococcus aureus (PGN-SA), respectively, suggesting their antimicrobial activity against Gram-negative and Gram-positive microorganisms. These results describe for the first time the basic properties of the cecropin-2 and defensin genes from B. dorsalis that probably play an important role in the defense response against invading microbes.