  We prove the existence and uniqueness of K\"ahler-Einstein metrics on Q-Fano
varieties with log terminal singularities (and more generally on log Fano
pairs) whose Mabuchi functional is proper. We study analogues of the works of
Perelman on the convergence of the normalized K\"ahler-Ricci flow, and of
Keller, Rubinstein on its discrete version, Ricci iteration. In the special
case of (non-singular) Fano manifolds, our results on Ricci iteration yield
smooth convergence without any additional condition, improving on previous
results. Our result for the K\"ahler-Ricci flow provides weak convergence
independently of Perelman's celebrated estimates.
