The Medicago truncatula gene encoding an evolutionarily conserved antifungal defensin MtDef4.2 was cloned and characterized. In silico expression analysis indicated that MtDef4.2 is expressed in many tissues during the normal growth and development of M. truncatula. MtDef4.2 exhibits potent broad-spectrum antifungal activity against various Fusarium spp. Transgenic Arabidopsis thaliana lines in which MtDef4.2 was targeted to three different subcellular compartments were generated. These lines were tested for resistance to the obligate biotrophic oomycete Hyaloperonospora arabidopsidis Noco2 and the hemibiotrophic fungal pathogen Fusarium graminearum PH-1. MtDef4.2 directed to the extracellular space, but not to the vacuole or retained in the endoplasmic reticulum, conferred robust resistance to H. arabidopsidis. Siliques of transgenic Arabidopsis lines expressing either extracellularly or intracellularly targeted MtDef4.2 displayed low levels of resistance to F. graminearum, but accumulated substantially reduced levels of the mycotoxin deoxynivalenol. The data presented here suggest that extracellularly targeted MtDef4.2 is sufficient to provide strong resistance to the biotrophic oomycete, consistent with the extracellular lifestyle of this pathogen. However, the co-expression of extracellular and intracellular MtDef4.2 is probably required to achieve strong resistance to the hemibiotrophic pathogen F. graminearum which grows extracellularly and intracellularly.