Many microorganisms produce surface-active substances that enhance the availability of water-insoluble substrates. Although many of these biosurfactants have interesting potential applications, very little is known about their biosynthesis. The basidiomycetous fungus Ustilago maydis secretes large amounts of mannosylerythritol lipids (MELs) under conditions of nitrogen starvation. We recently described a putative glycosyltransferase, Emt1, which is essential for MEL biosynthesis and whose expression is strongly induced by nitrogen limitation. We used DNA microarray analysis to identify additional genes involved in MEL biosynthesis. Here we show that emt1 is part of a gene cluster which comprises five open reading frames. Three of the newly identified proteins, Mac1, Mac2, and Mat1, contain short sequence motifs characteristic for acyl-and acetyltransferases. Mutational analysis revealed that Mac1 and Mac2 are essential for MEL production, which suggests that they are involved in the acylation of mannosylerythritol. Deletion of mat1 resulted in the secretion of completely deacetylated MELs, as determined by mass spectrometry. We overexpressed Mat1 in Escherichia coli and demonstrated that this enzyme acts as an acetyl coenzyme A-dependent acetyltransferase. Remarkably, Mat1 displays relaxed regioselectivity and is able to acetylate mannosylerythritol at both the C-4 and C-6 hydroxyl groups. Based on these results, we propose a biosynthesis pathway for the generation of mannosylerythritol lipids in U. maydis.