The soils of the Barranca valley are among the best soils in Peru, but with so many years of application of agrochemicals and other agricultural practices, they are losing their productive capacity. Consequently, it was suggested to assess the impact of Crotalaria juncea L. as a green manure on soil fertility and the populations of bacteria and fungi present in the soil. Crotalaria was cultivated for 75 days and incorporated as green manure. After 90 days, the presence of bacteria and fungi was evaluated. Metabarcoding was employed, and the 16S rRNA and ITS2 amplicons were sequenced using the Illumina MiSeq platform. The sequences were processed using various bioinformatics tools. The results indicate that soils have a high diversity of bacteria and fungi. Likewise, in plots where the presence and action of natural biocontrol is suppressed (C0 and P0), pathogenic fungi increase their population in the fallow period (C1), while in P1, the addition of Crotalaria as a green manure promotes an increase in the population of bacteria and fungi, and at the same time it suppresses pathogenic fungi. The genera (bacterial and/or fungal) that increase due to the effect of Crotalaria are beneficial because they are involved as degraders of organic matter, promotion of plant growth and biological control of pathogens. Crotalaria is an alternative to improve soil fertility, increase the beneficial bacterial population, and reduce pathogenic fungi.