Carbamoylphosphate is a common intermediate in the metabolic pathways leading to the biosynthesis of arginine and pyrimidines. The amino acid sequences of all available proteins that catalyze the formation of carbamoylphosphate were retrieved from Genbank and aligned to estimate their mutual phylogenetic relations. In gram-negative bacteria carbamoylphosphate is synthesized by a two-subunit enzyme with glutaminase and carbamoylphosphate synthetase (CPS) activity, respectively. In gram-positive bacteria and lower eukaryotes this two-subunit CPS has become dedicated to arginine biosynthesis, while in higher eukaryotes the two subunits fused and subsequently lost the glutaminase activity. The CPS dedicated to pyrimidine synthesis is part of a multifunctional enzyme (CPS II), encoding in addition dihydroorotase and aspartate transcarbamoylase. Evidence is presented to strengthen the hypothesis that the two "kinase" subdomains of all CPS isozymes arose from a duplication of an ancestral gene in the progenote. A further duplication of the entire CPS gene occurred after the divergence of the plants and before the divergence of the fungi from the eukaryotic root, generating the two isoenzymes involved in either the synthesis of arginine or that of pyrimidines. The mutation rate was found to be five- to tenfold higher after the duplication than before, probably reflecting optimization of the enzymes for their newly acquired specialized function. We hypothesize that this duplication arose from a need for metabolic channeling for pyrimidine biosynthesis as it was accompanied by the tagging of the CPS gene with the genes for dihydroorotase and aspartate transcarbamoylase, and as the duplication occurred independently also in gram-positive bacteria. Analysis of the exon-intron organization of the two "kinase" subdomains in CPS I and II suggests that ancient exons may have comprised approx. 19 amino acids, in accordance with the prediction of the "intron-early" theory.