We construct the integration measure over the moduli space of an arbitrary number of N kinds of dyons of the pure SU(N) gauge theory at finite temperatures. The ensemble of dyons governed by the measure is mathematically described by a (supersymmetric) quantum field theory that is exactly solvable and is remarkable for a number of striking features: (i) The free energy has the minimum corresponding to the zero average Polyakov line, as expected in the confining phase; (ii) the correlation function of two Polyakov lines exhibits a linear potential between static quarks in any N-ality nonzero representation, with a calculable string tension roughly independent of temperature; (iii) the average spatial Wilson loop falls off exponentially with its area and the same string tension; (iv) at a critical temperature, the ensemble of dyons rearranges and deconfines; and (v) the estimated ratio of the critical temperature to the square root of the string tension is in excellent agreement with the lattice data.