Leguminous locoweeds cause toxicosis to grazing animals in western China and western USA. Swainsonine, a toxic alkaloid, is produced by the endophytic fungus Alternaria section Undifilum sp. living within the locoweed plants. Nothing is known of the other endogenous fungi associated with locoweed and it is unknown if the presence of Alternaria sect. Undifilum sp., a potential mutualist, in a locoweed influences the fungal microbiome associated with the plant. To help address these questions, endogenous fungi associated with three locoweed species (Oxytropis glabra, Sphaerophysa salsula, and Astragalus variabilis) collected from grasslands from western China were evaluated. Fungi were isolated from the tissues and identified by morphological features and sequencing of the internal transcribed spacer (ITS) regions. A total of 1209 fungal isolates were obtained from 1819 tissues for an isolation rate of 66.5%. Alternaria sect. Undifilum oxytropis, Alternaria spp. and Fusarium spp. were most commonly isolated. Plant host species, plant part, and environment influenced the endogenous fungal communities isolated from the locoweed plants. There were significant differences in the diversity of fungal species isolated from O. glabra from two sites, and no differences between the diversity of fungi isolated from A. variabilis from two sites. Alternaria sect. Undifilum was found most frequently associated with toxic locoweeds. Plants or plant parts that did not yield this endophyte had more plant pathogenic fungi associated with them. This is the first report of the diversity of fungi associated with these locoweeds and the first to suggest a beneficial role for Undifilum.