Caffeine (1,3,7-trimethylxanthine) is a secondary metabolite produced by certain plant species and an important component of coffee (Coffea arabica and Coffea canephora) and tea (Camellia sinensis). Here we describe the structures of two S-adenosyl-l-methionine-dependent N-methyltransferases that