The common fruit fly, Drosophila melanogaster is an outstanding model to analyze the regulation of conserved signaling pathways. In this study, we examined whether signaling components in the Bone Morphogenic Protein (BMP) branch of the TGF-β signaling pathway are involved in the response to wounding caused by either sterile injury or infection by parasitic nematodes in D. melanogaster adult flies. We found that following sterile injury, the BMP pathway Type I receptor sax and intracellular transcription factor Mad were substantially upregulated. Also, inactivation of Mad or dpp promoted fly survival and increased antimicrobial peptide gene transcript levels upon sterile injury or H. bacteriophora nematode infection, respectively, but not against the bacterial pathogen Photorhabdus luminescens. Our findings indicate the roles of certain BMP signaling components in the regulation of the fly immune response against sterile injury or nematode infection. In conclusion, this study highlights the ability of D. melanogaster to activate the BMP branch of TGF-β signaling in order to modulate the response to injury in the absence or presence of pathogenic infection.