Introduction: Flavonoids are a group of polyphenolic compounds naturally found in plants. Many flavonoids are the basis of herbal medicines and have effective pharmacological effects. Rutin is one of the flavonoids used as a reagent in the study of flavonoids and is also considered an antioxidant. This study was conducted to isolate and identify rutin-producing endophytic fungi from C. spinosa. Materials and Methods: Sampling was performed in 10 regions of Iran and was taken from different tissues (including leaves, stems, roots, and fruits). After surface disinfection, explants were placed on a PDA medium and the fungal isolates were purified. Molecular identification of isolates was performed by sequencing ITS1-5.8S-ITS2. Morphological identification of fungi was performed by microscopic slide preparation and fungus identification keys. Methanolic extract of fungi was prepared by the maceration method and the presence of rutin was investigated using the HPLC technique. Results: A total of 24 fungi were identified. HPLC analysis showed that the peak of standard flavonoids including rutin, quercetin, and apigenin appeared at 3.82, 7.60, and 12.40 min, respectively. Results showed that only two isolates were able to produce rutin. A comparison of the mean production of rutin showed a significant difference between the two fungi. Alternaria alternata M28 (22.94 ppm) had the highest amount of rutin production. Results also showed that rutin production in the mycelial tissue was more than160 Biological Journal of Microorganism, Year 11, Vol.11, No.44, Winter 2023 in the extracellular medium, so A. alternata M28 and Paecilomyces maximus M7 had rutin content of about 67.5 and 5.56 times, respectively. Discussion and Conclusion: Fungal rutin in methanolic extracts was characterized by HPLC. This is the first report showing that endophytic fungi have a potential for rutin production from C. spinosa and more research on these isolates can increase the amount of rutin product