Spores of Bacillus anthracis, the causative agent of anthrax, are enclosed by a loosely fitting exosporium composed of a basal layer and an external hair-like nap. The filaments of the nap are formed by trimers of the collagen-like glycoprotein BclA. The side chains of BclA include multiple copies of two linear rhamnose-containing oligosaccharides, a trisaccharide and a pentasaccharide. The pentasaccharide terminates with the unusual deoxyamino sugar anthrose. Both oligosaccharide side chains are linked to the BclA protein backbone through an N-acetylgalactosamine (GalNAc) residue. To identify the gene encoding the epimerase required to produce GalNAc for BclA oligosaccharide biosynthesis, three annotated UDP-glucose 4-epimerase genes of B. anthracis were cloned and expressed in Escherichia coli. The candidate proteins were purified, and their enzymatic activities were assessed. Only two proteins, encoded by the BAS5114 and BAS5304 genes (B. anthracis Sterne designations), exhibited epimerase activity. Both proteins were able to convert UDP-glucose (Glc) to UDP-Gal, but only the BAS5304-encoded protein could convert UDP-GlcNAc to UDP-GalNAc, indicating that BAS5304 was the gene sought. Surprisingly, spores produced by a mutant strain lacking the BAS5304-encoded enzyme still contained normal levels of BclA-attached oligosaccharides. However, monosaccharide analysis of the oligosaccharides revealed that GlcNAc had replaced GalNAc. Thus, while GalNAc appears to be the preferred amino sugar for the linkage of oligosaccharides to the BclA protein backbone, in its absence, GlcNAc can serve as a substitute linker. Finally, we demonstrated that the expression of the BAS5304 gene occurred in a biphasic manner during both the early and late stages of sporulation.