Antibacterial factors (ABFs) are secreted polypeptides that have an important role in the innate immune system of nematodes. Comparison of these polypeptides revealed similarity in bioactivity, protein sequence and 3D structure, suggesting that they originated from a common ancestor. Comparison of gene organization of nematode ABF genes revealed that all except one contain a Phase 0 intron at a conserved location. The intron phase and location are congruent with the postulated intron gain rules, suggesting a gain of intron before duplication and divergence of the ancestral gene. Although nematode ABFs display similarity in activity and structure to invertebrate (arthropod and mollusk) defensins, lack of sequence similarity and the different genomic organization suggest that these two polypeptide families exhibit convergent evolution.