Given a closed, oriented surface X of genus g ≥ 2, and a semisimple Lie group G, let [Formula: see text] be the moduli space of reductive representations of π1X in G. We determine the number of connected components of [Formula: see text], for n ≥ 4 even. In order to have a first division of connected components, we first classify real projective bundles over such a surface. Then we achieve our goal, using holomorphic methods through the theory of Higgs bundles over compact Riemann surfaces. We also show that the complement of the Hitchin component in [Formula: see text] is homotopically equivalent to [Formula: see text].