A dirty BCS superconductor with magnetic impurities is studied. Theasymptotic solution of the thermodynamics of such a superconductor with spin1/2 and7/2 magnetic impurities is found. To this end, the system’s free energyf(H, β) is bounded from above and below by mean-field type bounds, which are shownto coalesce almost exactly in the thermodynamic limit, provided the impurityconcentration is sufficiently small. The resulting mean-field equations for the gapΔ and aparameter ν, characterizing the impurity subsystem, are solved and the solution minimizingf is found for various values of magnetic coupling constantg and impurityconcentration x. The phase diagrams of the system are depicted with five distinct phases: the normalphase, unperturbed superconducting phase, perturbed superconducting phase with nonzerogap in the excitation spectrum, perturbed gapless superconducting phase andimpurity phase with completely suppressed superconductivity. In the perturbedsuperconducting phase, superconductivity coexists with magnetic order. Thecomputed phase diagrams are in good agreement with experimental data forCe1 − xGdxRu2 and for certainpseudoternary systems, e.g. (Er1 − xHox)Rh4B4.Furthermore, evidence of reentrant superconductivity and Jaccarino–Peter compensation isfound.The credibility of the theory is verified by testing the dependence of the superconducting transitiontemperature Tc on x. Very good quantitative agreement with experimental data is obtained for several alloys:(La1 − xCex)Al2,(La1 − xGdx)Al2 and(La0.8 − xY0.20)Cex. The theory presented improves earlier developments in this field.