The disaccharide d-N-acetylglucosamine-l-rhamnose plays an important role in the mycobacterial cell wall as a linker connecting arabinogalactan and peptidoglycan via a phosphodiester linkage. The first step of the disaccharide linker is the formation of decaprenyl phosphate-GlcNAc, which is catalyzed by GlcNAc-1-phosphate transferase. In Gram-negative bacteria, the wecA gene specifies the UDP-GlcNAc: undecaprenyl phosphate GlcNAc-1-phosphate transferase (WecA), which catalyzes the first step in the biosynthesis of lipopolysaccharide O-antigen. Mycobacterium tuberculosis Rv1302 and Mycobacterium smegmatis MSMEG_4947 show homology to Escherichia coli WecA protein. We cloned Rv1302 and MSMEG_4947 and introduced plasmids pYJ-1 (carrying Rv1302) and pYJ-2 (carrying MSMEG_4947) into a wecA-defective strain of E. coli MV501, respectively. Lipopolysaccharide analysis demonstrated that lipopolysaccharide synthesis in MV501 (pYJ-1) and MV501 (pYJ-2) was restored upon complementation with Rv1302 and MSMEG_4947, respectively. This provides the first evidence that Rv1302 and MSMEG_4947 have the same function as E. coli WecA. We also generated an M. smegmatis MSMEG_4947 knockout mutant using a homologous recombination strategy. The disruption of MSMEG_4947 in the M. smegmatis genome resulted in the loss of viability at a nonpermissive temperature. Scanning electron microscopy and transmission electron microscopy results showed that the lack of the MSMEG_4947 protein causes drastic morphological changes in M. smegmatis.