  We present a semiclassical description of the SU(N) Yang--Mills theory whose
partition function at nonzero temperatures is approximated by that of an
ensemble of N kinds of interacting dyons. The ensemble is mathematically
described by an exactly solvable 3d quantum field theory, allowing calculation
of correlations functions relevant to confinement. We show that all known
criteria of confinement are satisfied in this semiclassical approximation: (i)
the average Polyakov line is zero below some critical temperature, and nonzero
above it, (ii) static quarks in any nonzero N-ality representation have linear
rising potential energy, (iii) the average spatial Wilson loop falls off
exponentially with the area, (iv) N^2 gluons are canceled out from the
spectrum, (v) the critical temperature is in good agreement with lattice data.
