Let us fix a conformal class [g 0 ] and a spin structure σ on a compact manifold M . For any g ∈ [g 0 ], let λ + 1 (g) be the smallest positive eigenvalue of the Dirac operator D on (M, g, σ). In a previous article we have shown thatIn the present article, we enlarge the conformal class by adding certain singular metrics. We will show that if λ + min (M, g 0 , σ) < λ + min (S n ), then the infimum is attained on the enlarged conformal class. For proving this, we solve a system of semi-linear partial differential equations involving a nonlinearity with critical exponent: Dϕ = λ|ϕ| 2/(n−1) ϕ.The solution of this problem has many analogies to the solution of the Yamabe problem. However, our reasoning is more involved than in the Yamabe problem as the eigenvalues of the Dirac operator tend to +∞ and −∞. Using the spinorial Weierstraß representation, the solution of this equation in dimension 2 shows the existence of many periodic constant mean curvature surfaces.