For systems with long-range interactions, the two-body potential decays at large distances as V (r) ∼ 1/r α , with α ≤ d, where d is the space dimension. Examples are: gravitational systems, two-dimensional hydrodynamics, two-dimensional elasticity, charged and dipolar systems. Although such systems can be made extensive, they are intrinsically non additive: the sum of the energies of macroscopic subsystems is not equal to the energy of the whole system. Moreover, the space of accessible macroscopic thermodynamic parameters might be non convex. The violation of these two basic properties of the thermodynamics of short-range systems is at the origin of ensemble inequivalence. In turn, this inequivalence implies that specific heat can be negative in the microcanonical ensemble, temperature jumps can appear at microcanonical first order phase transitions. The lack of convexity allows us to easily spot regions of parameters space where ergodicity may be broken. Historically, negative specific heat had been found for gravitational systems and was thought to be a specific property of a system for which the existence of standard equilibrium statistical mechanics itself was doubted. Realizing that such properties may be present for a wider class of systems has renewed the interest in long-range interactions. Here, we present a comprehensive review of the recent advances on the statistical mechanics and out-of-equilibrium dynamics of solvable systems with long-range interactions. The core of the review consists in the detailed presentation of the concept of ensemble inequivalence, as exemplified by the exact solution, in the microcanonical and canonical ensembles, of mean-field type models. Remarkably, the entropy of all these models can be obtained using the method of large deviations. Long-range interacting systems display an extremely slow relaxation towards thermodynamic equilibrium and, what is more striking, the convergence towards quasi-stationary states. The understanding of such unusual relaxation process is obtained by the introduction of an appropriate kinetic theory based on the Vlasov equation. A statistical approach, founded on a variational principle introduced by Lynden-Bell, is shown to explain qualitatively and quantitatively some features of quasi-stationary states. Generalizations to models with both short and long-range interactions, and to models with weakly decaying interactions, show the robustness of the effects obtained for mean-field models.