Endophytic fungi were isolated from nine plant species growing on gypsum and saline soils in central Spain. The plants sampled were Arundo donax, Atriplex halimus, Diplotaxis erucoides, Ephedra nebrodensis, Phragmites australis, Rosmarinus officinalis, Scirpus holoschoenus, S. maritimus and Stipa tenacissima. A total of 152 fungal species were recovered from 2880 samples of leaves, stems or twigs, taken from 45 individual plants. Ephedra and Rosmarinus showed the highest diversity of endophytes, whereas both species of Scirpus showed the lowest. The most frequently isolated fungi were Alternaria alternata, Sporormiella intermedia, Rhizoctonia sp., Epicoccum purpurascens, Pleospora herbarum, Cladosporium herbarum, Sporormiella australis and a sterile fungus. A total of 187 strains belonging to 136 species were tested for the production of antimicrobial activities, using a panel of bacteria and yeasts, some of them of clinical relevance. Production of antimicrobial compounds was detected in 45 strains, belonging to 37 species. Large differences were observed among isolates from the same species, with respect to their ability to produce metabolites with antimicrobial activity.