Swainsonine—a cytotoxic fungal alkaloid and a potential cancer therapy drug—is produced by the insect pathogen and plant symbiont Metarhizium robertsii, the clover pathogen Slafractonia leguminicola, locoweed symbionts belonging to Alternaria sect. Undifilum, and a recently discovered morning glory symbiont belonging to order Chaetothyriales. Genome sequence analyses revealed that these fungi share orthologous gene clusters, designated “SWN,” which included a multifunctional swnK gene comprising predicted adenylylation and acyltransferase domains with their associated thiolation domains, a β-ketoacyl synthase domain, and two reductase domains. The role of swnK was demonstrated by inactivating it in M. robertsii through homologous gene replacement to give a ∆swnK mutant that produced no detectable swainsonine, then complementing the mutant with the wild-type gene to restore swainsonine biosynthesis. Other SWN cluster genes were predicted to encode two putative hydroxylases and two reductases, as expected to complete biosynthesis of swainsonine from the predicted SwnK product. SWN gene clusters were identified in six out of seven sequenced genomes of Metarhzium species, and in all 15 sequenced genomes of Arthrodermataceae, a family of fungi that cause athlete’s foot and ringworm diseases in humans and other mammals. Representative isolates of all of these species were cultured, and all Metarhizium spp. with SWN clusters, as well as all but one of the Arthrodermataceae, produced swainsonine. These results suggest a new biosynthetic hypothesis for this alkaloid, extending the known taxonomic breadth of swainsonine producers to at least four orders of Ascomycota, and suggest that swainsonine has roles in mutualistic symbioses and diseases of plants and animals.