  We introduce a concept of tree-graded metric space and we use it to show
quasi-isometry invariance of certain classes of relatively hyperbolic groups,
to obtain a characterization of relatively hyperbolic groups in terms of their
asymptotic cones, to find geometric properties of Cayley graphs of relatively
hyperbolic groups, and to construct the first example of finitely generated
group with a continuum of non-$\pi_1$-equivalent asymptotic cones. Note that by
a result of Kramer, Shelah, Tent and Thomas, continuum is the maximal possible
number of different asymptotic cones of a finitely generated group, provided
that the Continuum Hypothesis is true.
