The caffeine biosynthetic pathway is composed of three methylation steps, and N-methyltransferase catalyzing each step has high substrate specificity. Since the amino acid sequences among coffee 7-methylxanthosine synthase (CmXRS1), theobromine synthase, and caffeine synthase are highly homologous to each other, these substrate specificities seem to be determined in a very restricted region. The analysis of site-directed mutants for CmXRS1 that naturally acts at the initial step, i.e., 7-N methylation of xanthosine, revealed that the activity of 3-N methylation needs a histidine residue at corresponding position 161 in the CmXRS1 sequence. We succeeded in producing the mutant enzyme which can catalyze the first and second methylation steps in caffeine biosynthesis.