| Résume||We consider the moduli space of G-Higgs bundles over a compact Riemann surface X, where G is a real semisimple Lie group. By the non-abelian Hodge correspondence this is homeomorphic to the moduli space of representations of the fundamental group of X in G. We are interested in the fixed point subvarieties under the action of C*, obtained by rescaling the Higgs field. The fixed points correspond to variations of Hodge structure and are critical points of the Hitchin functional — a Morse function defined on the moduli space of Higgs bundles. We show that one can define in this context an invariant that generalizes the Toledo invariant in the case where G is of Hermitian type. Moreover, there are bounds on this invariant similar to the Milnor–Wood inequalities of the Hermitian case. These bounds also generalize the Arakelov inequalities of classical Hodge bundles arising from families of varieties over a compact Riemann surface. We explore the case where this invariant is maximal, and show that there is a rigidity phenomenon, relating to Fuchsian representations, and which in particular allows the identification of higher Teichmueller components.