For a compact, connected Lie group G, we study the moduli of pairs (Sigma, E), where Sigma is a genus g Riemann surface and E -> Sigma is a flat G-bundle. Varying both the Riemann surface Sigma and the flat bundle leads to a moduli space M-g(G), parametrizing families Reimann surfaces with flat G-bundles. We show that there is a stable range in which the homology of M-g(G) is independent of g. The stable range depends on the genus of the surface. We then identify the homology of this moduli space in the stable range, in terms of the homology of an explicit infinite loop space. Rationally, the stable cohomology of this moduli space is generated by the Mumford-Morita-Miller kappa-classes, and the ring of characteristic classes of principal G-bundles, H*(BG). Equivalently, Our theorem calculates the homology of the moduli space of semi-stable holomorphic bundles on Riemann surfaces. We,then identify the homotopy type of the category of one-manifolds and surface cobordisms, each equipped with a flat G-bundle. Our methods combine the classical techniques of Atiyah and Bott, with the new techniques coming out of Madsen and Weiss's proof of Mumford's conjecture on the stable cohomology of the moduli space of Riemann surfaces. (C) 2009 Elsevier Inc. All rights reserved.