Eukaryotic mRNAs possess a 5′ cap structure that is cotranscriptionally formed in the nucleus. mRNA capping is essential for mRNA stability and efficient translation (13, 39). Most animal viruses that replicate in cytoplasm encode their own capping machinery to produce capped RNAs. RNA capping generally consists of three steps in which the 5′ triphosphate end of nascent RNA transcript is first hydrolyzed to a 5′ diphosphate by an RNA triphosphatase, then capped with GMP by an RNA guanylyltransferase, and finally methylated at the N-7 position of guanine by an RNA guanine-methyltransferase (N-7 MTase) (15). Additionally, the first and second nucleotides of many cellular and viral mRNAs are further methylated at the ribose 2′-OH position by a nucleoside 2′-O MTase, to form cap 1 (m7GpppNm) and cap 2 (m7GpppNmNm) structures, respectively (13). Both N-7 and 2′-O MTases use S-adenosyl-l-methionine (SAM) as a methyl donor and generate S-adenosyl-l-homocysteine (SAH) as a by-product. The order of capping and methylation varies among cellular and viral RNAs (13). The genus Flavivirus comprises approximately 70 viruses, many of which are important human pathogens, including four serotypes of dengue virus (DENV), yellow fever virus (YFV), St. Louis encephalitis virus, and West Nile virus (WNV) (23). The flavivirus genome is a single-stranded RNA of positive (i.e., mRNA sense) polarity. The 5′ end of the genome contains a type 1 cap followed by a conserved dinucleotide sequence 5′-AG-3′ (7, 41). The single open reading frame of the flavivirus genome encodes a polyprotein, which is processed by viral and cellular proteases into three structural proteins and seven nonstructural proteins (NS1, NS2A, NS2B, NS3, NS4A, NS4B, and NS5) (23). Of the four enzymes required for synthesis of flavivirus m7GpppAm cap structure, the RNA triphosphatase and 2′-O MTase have been, respectively, mapped to NS3 (20, 42) and NS5 (9). We recently showed that WNV NS5 carries both guanine N-7 and ribose 2′-O MTase activities (34). The guanylyltransferase for flavivirus capping remains elusive. Flavivirus NS5 consists of an N-terminal MTase and a C-terminal RNA-dependent-RNA polymerase (RdRp) domain (1, 16, 28). The structure of DENV-2 MTase suggests that flavivirus NS5 MTase belongs to a family of SAM-dependent MTases (9). Most of the MTases within this family, including both N-7 and 2′-O RNA MTases such as Encephalitozoon cuniculi (Ecm1) N-7 MTase and vaccinia virus 2′-O MTase VP39 (10, 18), share a common core structure referred to as a “SAM-dependent MTase fold,” composed of an open α/β/α sandwich structure (11, 24). Structure and sequence comparisons of the 2′-O MTases suggest that a conserved K-D-K-E tetrad forms the active site for the 2′-O methyl transfer reaction (9). Using Ala substitution, we recently showed that all residues within the K61-D146-K182-E218 tetrad of the WNV MTase are essential for 2′-O methylation activity, whereas D146 is more critical than the other three residues for N-7 methylation. In addition, we found that methylations of guanine N-7 and ribose 2′-O of the WNV cap structure are sequential, with N-7 preceding 2′-O methylation (34). The WNV MTase represents a unique system to study how a single enzyme catalyzes two distinct cap methylations. Here we report that, similar to the WNV, MTases from other flaviviruses also sequentially methylate viral RNA cap at guanine N-7 and ribose 2′-O positions, indicating that it is a general mechanism for flaviviruses to encode the NS5 MTase with dual methylation activities for an efficient synthesis of the viral RNA cap. By contrast, the crystal structure of the WNV MTase in complex with SAH shows only a single SAM-binding site. Thus, the 5′ cap of flavivirus RNA must evidently be repositioned to accept two methyl groups from SAM during methylations. Biochemical and mutagenesis analyses suggest that the WNV MTase methylates the N-7 and 2′-O positions using two distinct mechanisms. In the context of full-length WNV, a mutation (D146A) defective in both the N-7 and 2′-O methylations is lethal to the virus. Mutant viruses inactive for 2′-O but not N-7 methylation (K61A, K182A, or E218A) are attenuated in cell culture and in mice and can be used to protect mice from challenge with wild-type WNV.