Metamorphosis is an essential physiological process in insects. This process is triggered by 20-hydroxyecydsone (20E). Lebocin, an antimicrobial peptide of Lepidoptera insects, was significantly up-regulated in the midgut, but not in the fat body of Bombyx mori during metamorphosis. In this study, the expression regulation of lebocin in B. mori midgut was studied. The results showed that B. mori lebocin and its activator BmEts were not responsive to bacterial infection in the midgut, instead, the expression of both genes was up-regulated by 20E treatment. The transcription factor BR-C Z4 in the 20E signal pathway enhanced lebocin promoter activity by directly binding to an upstream cis-response element of the promoter. In the fat body, the mRNA level of B. mori lebocin was decreased when the insect transformed from larval to pupal stage and was increased by immune challenge. The expression profiles of lebocin in Lepidopteran Spodoptera litura was also analyzed and the similar results were observed, S. litura lebocin was significantly up-regulated during midgut regeneration and mainly present in the new-formed intestinal cells of the midgut. All results together suggest that during metamorphosis 20E may activate lebocin expression via BmBR-C Z4 and BmEts in the midgut, where the antimicrobial peptide was produced to protect the midgut from infection.