Flaviviruses encode a single methyltransferase domain that sequentially catalyzes two methylations of the viral RNA cap, GpppA-RNA-->m(7)GpppA-RNA-->m(7)GpppAm-RNA, by using S-adenosyl-l-methionine (SAM) as a methyl donor. Crystal structures of flavivirus methyltransferases exhibit distinct binding sites for SAM, GTP, and RNA molecules. Biochemical analysis of West Nile virus methyltransferase shows that the single SAM-binding site donates methyl groups to both N7 and 2'-O positions of the viral RNA cap, the GTP-binding pocket functions only during the 2'-O methylation, and two distinct sets of amino acids in the RNA-binding site are required for the N7 and 2'-O methylations. These results demonstrate that flavivirus methyltransferase catalyzes two cap methylations through a substrate-repositioning mechanism. In this mechanism, guanine N7 of substrate GpppA-RNA is first positioned to SAM to generate m(7)GpppA-RNA, after which the m(7)G moiety is repositioned to the GTP-binding pocket to register the 2'-OH of the adenosine with SAM, generating m(7)GpppAm-RNA. Because N7 cap methylation is essential for viral replication, inhibitors designed to block the pocket identified for the N7 cap methylation could be developed for flavivirus therapy.