Defensins are a group of plant antimicrobial peptides. In a previous study, it was reported that two recombinant rice (Oryza sativa L.) defensin (OsDEF) genes (OsDEF7 and OsDEF8) produced heterologously by bacteria inhibited the growth of several phytopathogen. Here, we analyzed gene expression patterns in Thai jasmine rice (O. sativa L. ssp. indica 'KDML 105') using quantitative reverse transcription-polymerase chain reaction and compared them with those in Japanese rice (O. sativa L. ssp. japonica 'Nipponbare'). Although the cultivars exhibited similar gene expression patterns at the developmental stages examined, the expression levels differed between organs. Upon Xanthomonas oryzae pv. oryzae infection in the leaves, both OsDEFs were highly upregulated at 8 days post-infection, suggesting that they play a role in pathogen defense. Moreover, in silico analyses revealed that OsDEF expression levels were affected by drought, cold, imbibition, anoxia, and dehydration stress. Using green fluorescent protein (GFP) fusions, we found that both OsDEFs were in the extracellular compartment, confirming their functions against pathogen infection. However, when recombinant OsDEFs (without GFP) were produced in tobacco BY-2 cells or Nicotiana benthamiana leaves, they could not be detected in either the culture medium or the cells. Yet, N. benthamiana leaves infiltrated with OsDEF7 or OsDEF8 constructs exhibited in planta inhibitory activity against the phytopathogen Xanthomonas campestris pv. glycines, suggesting that recombinant OsDEFs were present. Additionally, when targeting them to the ER compartment, recombinant OsDEFs could be detected. Lower inhibitory activity was observed when recombinant OsDEFs were targeted to the ER. These results suggest that OsDEFs play a role in controlling plant diseases. Copyright © 2018 Elsevier Masson SAS. All rights reserved.