Formation of extracellular traps (ETs) capturing and immobilizing pathogens is now a well-established defense mechanism added to the repertoire of vertebrate phagocytes. These ETs are composed of extracellular DNA (extDNA), histones and antimicrobial proteins. Formation of mouse and human ETs depends on enzymes (i) facilitating decondensation of chromatin by citrullination of histones, and (ii) serine proteases degrading histones. In invertebrates, initial reports revealed existence of ETs composed of extDNA and histones, and here we document for the first time that also coelomocytes, immunocompetent cells of an earthworm Eisenia andrei, cast ETs which successfully trap bacteria in a reactive oxygen species (ROS)-dependent and -independent manner. Importantly, the formation of ETs was observed not only when coelomocytes were studied ex vivo, but also in vivo, directly in the earthworm coelom. These ETs were composed of extDNA, heat shock proteins (HSP27) and H3 histones. Furthermore, the formation of E. andrei ETs depended on activity of serine proteases, including elastase-like activity. Moreover, ETs interconnected and hold together aggregating coelomocytes, a processes proceeding encapsulation. In conclusion, the study confirms ET formation by earthworms, and unravels mechanisms leading to ET formation and encapsulation in invertebrates.