We show that noncommutative gauge theory in two dimensions is an exactly solvable model. A cohomological formulation of gauge theory defined on the noncommutative torus is used to show that its quantum partition function can be written as a sum over contributions from classical solutions. We derive an explicit formula for the partition function of Yang-Mills theory defined on a projective module for an arbitrary noncommutativity parameter ? which is manifestly invariant under gauge Monta equivalence. The energy observables are shown to be smooth functions of ?. The construction of noncommutative instanton contributions to the path integral is described in some detail. In general, there are infinitely many gauge inequivalent contributions of fixed topological charge, along with a finite number of quantum fluctuations about each instanton. The associated moduli spaces are combinations of symmetric products of an ordinary two-torus whose orbifold singularities are not resolved by noncommutativity. In particular, the weak coupling limit of the gauge theory is independent of ? and computes the symplectic volume of the moduli space of constant curvature connections on the noncommutative torus.