Let Σ be a closed surface of genus ≥ 1, G a compact Lie group, not necessarily connected with Lie algebra g, ξ,: P → Σ a principal G-bundle, and suppose Σ equipped with a Riemannian metric and g with an invariant scalar product so that the Yang—Mills equations on ξ are defined. Further, let
be the universal central extension of the fundamental group π of Σ and ΓR the group obtained from Γ when its centre Z is extended to the additive group R of the reals. We show that there are bijective correspondences between various spaces of classes of Yang—Mills connections on ξ and spaces of representations of Γ and ΓR (as appropriate) in G. In particular, we show that the holonomy establishes a homeomorphism between the moduli space N(ξ) of central Yang–Mills connections on ξ and the space Repξ(Γ, G) of representations of Γ in G determined by ξ. Our results rely on a detailed study of the holonomy of a central Yang–Mills connection and extend corresponding ones of Atiyah and Bott for the case where G is connected.