Let G be a compact connected Lie group with π1(G)≅Z. We study the homotopy types of gauge groups of principal G-bundles over Riemann surfaces. This can be applied to an explicit computation of the homotopy groups of the moduli spaces of stable vector bundles over Riemann surfaces.