Using comparative analysis of genes, operons, and regulatory elements, we describe the cobalamin (vitamin B12) biosynthetic pathway in available prokaryotic genomes. Here we found a highly conserved RNA secondary structure, the regulatory B12 element, which is widely distributed in the upstream regions of cobalamin biosynthetic/transport genes in eubacteria. In addition, the binding signal (CBL-box) for a hypothetical B12 regulator was identified in some archaea. A search for B12 elements and CBL-boxes and positional analysis identified a large number of new candidate B12-regulated genes in various prokaryotes. Among newly assigned functions associated with the cobalamin biosynthesis, there are several new types of cobalt transporters, ChlI and ChlD subunits of the CobN-dependent cobaltochelatase complex, cobalt reductase BluB, adenosyltransferase PduO, several new proteins linked to the lower ligand assembly pathway, l-threonine kinase PduX, and a large number of other hypothetical proteins. Most missing genes detected within the cobalamin biosynthetic pathways of various bacteria were identified as nonorthologous substitutes. The variable parts of the cobalamin metabolism appear to be the cobalt transport and insertion, the CobG/CbiG- and CobF/CbiD-catalyzed reactions, and the lower ligand synthesis pathway. The most interesting result of analysis of B12 elements is that B12-independent isozymes of the methionine synthase and ribonucleotide reductase are regulated by B12 elements in bacteria that have both B12-dependent and B12-independent isozymes. Moreover, B12 regulons of various bacteria are thought to include enzymes from known B12-dependent or alternative pathways.