In this paper we prove a compactness result for Ricci flows with bounded scalar curvature and entropy. It states that given any sequence of such Ricci flows, we can pass to a subsequence that converges to a metric space which is smooth away from a set of codimension $geq 4$. The result has two main consequences: First, it implies that singularities in Ricci flows with bounded scalar curvature have codimension $geq 4$ and, second, it establishes a general form of the Hamilton-Tian Conjecture, which is even true in the Riemannian case. In the course of the proof, we will also establish the following results: $L^{p < 4}$ curvature bounds, integral bounds on the curvature radius, Gromov-Hausdorff closeness of time-slices, an $varepsilon$-regularity theorem for Ricci flows and an improved backwards pseudolocality theorem.