N-acetylserotonin methyltransferase (ASMT), the last enzyme in the synthesis of melatonin, catalyzes N-acetylserotonin into melatonin. For the first time, we cloned ASMT from rice through the analysis of recombinant Escherichia coli harboring putative rice O-methyltransferase (OMT) cDNAs. In total, 18 full-length cDNAs, which show homology to wheat caffeic acid 3-O-methyltransferase, were expressed in E. coli and induced in the presence of N-acetylserotonin; we then analyzed the production of melatonin. Only recombinant E. coli line 15 showed melatonin synthesis; no other recombinant lines produced melatonin with the addition of N-acetylserotonin in E. coli culture. Line 15 clearly exhibited in vitro ASMT enzyme activity with 0.27 pkat/mg protein. ASMT enzyme activity was inhibited by various related compounds such as N-acetyltryptamine and N-acetyltyrosine. The open reading frame of ASMT consists of 364 amino acids possessing well-conserved motifs found in plant OMT such as S-adenosyl-L-methionine-binding and catalytic sites. Induction patterns of ASMT mRNA were well matched with the production of melatonin in rice leaves during senescence, as well as several stressors.