An innate immune system intricately leverages unique mechanisms to inhibit colonization of external invasive Bacteria, for example human defensin-6, through responsive encapsulation of bacteria. Infection and accompanying antibiotic resistance stemming from Gram-negative bacteria aggregation represent an emerging public health crisis, which calls for research into novel anti-bacterial therapeutics. Herein, inspired by naturally found host-defense peptides, we design a defensin-like peptide ligand, bacteria extracellular trap (BET) peptide, with modular design composed of targeting, assembly, and hydrophobic motifs with an aggregation-induced emission feature. The ligand specifically recognizes Gram-negative bacteria via targeting cell wall conserved lipopolysaccharides (LPS) and transforms from nanoparticles to nanofibrous networks in situ to trap bacteria and induce aggregation. Importantly, treatment of the BET peptide was found to have an antibacterial effect on the Pseudomonas aeruginosa strain, which is comparable to neomycin. Animal studies further demonstrate its ability to trigger aggregation of bacteria in vivo. This biomimetic self-assembling BET peptide provides a novel approach to fight against pathogenic Gram-negative bacteria.