Attacin is a well-studied glycine-rich antibacterial protein in insect immune response, which has limitary antibacterial effect to some Gram-negative bacteria. A cDNA encoding the attacin gene was screened and isolated from the immunized larvae of the swallowtail butterfly, Papilio xuthus. The complete P. xuthus attacin cDNA is 949 nucleotides encoding a 250 amino acid precursor that contains a putative 18-residue signal peptide, a common 42-residue propeptide sequence and a presumed 190-residue mature protein with a theoretical mass of 19904.01 and a pI of 9.13. The putative mature protein of P. xuthus attacin showed 48%~52% and 24%~30% identity in amino acid sequences with that of lepidopteran and dipteran insects, respectively. The attacin transcript was induced at significant level after injection with bacterial lipopolysaccharide (LPS). Recombinant attacin was highly expressed in E. coli BL21 (DE3) cells by fusing with an N-terminal S-tag/thrombin cleavage site configuration protein to avoid the cell death during induction. The expressed fusion protein was purified by Ni-NTA immobilized metal affinity chromatography (IMAC). After desalting and cleavage with thrombin, the recombinant attacin was released and showed considerably antibacterial activity against Gram-negative bacteria, E. coli ML 35. Our results proved that this protein family with a potent antibacterial activity may play a role in the immune response of butterflies.