The cyclic tetrapeptide HC-toxin is an essential virulence determinant for the plant pathogenic fungus Cochliobolus carbonum and an inhibitor of histone deacetylase. The major form of HC-toxin contains the D-isomers of Ala and Pro. The non-ribosomal peptide synthetase that synthesizes HC-toxin has only one epimerizing domain for conversion of L-Pro to D-Pro; the source of D-Ala has remained unknown. Here we present the cloning and characterization of a new gene involved in HC-toxin biosynthesis, TOXG. TOXG is present only in HC-toxin-producing (Tox2+) isolates of C. carbonum. TOXG is able to support D-Ala-independent growth of a strain of Escherichia coli defective in D-Ala synthesis. A C. carbonum strain with both of its copies of TOXG mutated grows normally in culture, and although it no longer makes the three forms of HC-toxin that contain D-Ala, it still makes a minor form of HC-toxin that contains Gly in place of D-Ala. The addition of D-Ala to the culture medium restores production of the D-Ala-containing forms of HC-toxin by the toxG mutant. The toxG mutant has only partially reduced virulence. It is concluded that TOXG encodes an alanine racemase whose function is to synthesize D-Ala for incorporation into HC-toxin.