Cecropins are antibacterial peptides, induced in Drosophila as part of the humoral immune response to a bacterial invasion. We have used the cloned Drosophila cecropin genes CecA1, A2 and B as probes to study the developmental and tissue specific regulation of this response. The genes are strongly expressed in fat body and hemocytes after injection of bacteria, the CecA genes being much more active than CecB in the fat body. All parts of the fat body and 5-10% of the hemocytes are involved in this response. CecA1 and A2 are most active in larvae and adults; CecB is preferentially active in early pupae. A small peak of constitutive cecropin expression in early pupae appears to be caused by bacteria in the food. Cecropin A, the common product of the CecA1 and A2 genes, was identified in the hemolymph of immunized flies at a concentration of 25-50 microM, enough to kill all tested bacteria except Serratia, a Drosophila pathogen. A useful in vitro system to study the immune response has been found in Schneider's line 2 cells which respond to lipopolysaccharide and laminarin by cecropin expression.