  We define the Toledo invariant of a G-Higgs bundle on a Riemann surface,
where G is a real semisimple group of Hermitian type, and we prove a
Milnor-Wood type bound for this invariant when the bundle is semistable.
  We prove rigidity results when the Toledo invariant is maximal, establishing
in particular a Cayley correspondence when the symmetric space defined by G is
of tube type.
  This gives a new proof of the Milnor-Wood inequality of Burger-Iozzi-Wienhard
for representations of the fundamental group of a Riemann surface into G.
Compared to previous results using Higgs bundles, it uses general theory and
avoids any case by case study.
