Abundance and diversity of fungi in naturally formed knots of Pinus sylvestris affected by Porodaedalea pini were investigated. Samples were taken from trees that were (i) affected, with internal heartwood decay and no conks, (ii) affected, with internal heartwood decay and conks and (iii) controls. The Illumina sequencing technology was used for amplification of DNA, sequencing and analysis. In total, 566,279 raw sequences were obtained from six samples. Sequences included 74% of culturable and 8.4% of non‐culturable fungi and 17.6% of organisms with no reference sequences in NCBI. Abundance of organisms in knotwood, measured as number of OTUs, ranged from 36,272 (29,506 for fungi) to 178,535 (177,484 for fungi) and differed significantly between two trees in a stand and between stands. The highest and lowest average number of fungal OTUs occurred in infected trees with no conks and in trees with conks, respectively. Number of taxa ranged from 171 to 415 and often differed significantly between two trees in one stand and between stands. Greatest diversity occurred in control trees. The number of fungal taxa shared by two trees in one stand was 67–152 and that shared by two stands was 51–141. The majority of fungi were Ascomycota. Those most common in pines affected by P. pini were Coniochaeta hoffmannii and C. fodinicola (19.65%–59.92%). Infundichalara microchona, Leotiomycetes spp. and Rhinocladiella atrovirens were also present. Another common species, Lecanora conizaeoides, occurred most often in control trees (0.30%–8.82%). Porodaedalea pini was detected only sporadically. Non‐culturable fungi were most frequent in the control trees. The greater average abundance and smaller average diversity of fungi in knots of trees infected by P. pini suggest that the pathogen successfully competes with some fungal species and does not inhibit the growth of survivors. Some fungi detected may contribute to production of natural biocides.