We consider the effect of compactification of extra dimensions on the onset of classical chaotic Mixmaster behavior during cosmic contraction. Assuming a universe that is well-approximated as a four-dimensional Friedmann-Robertson--Walker model (with negligible Kaluza-Klein excitations) when the contraction phase begins, we identify compactifications that allow a smooth contraction and delay the onset of chaos until arbitrarily close the big crunch. These compactifications are defined by the de Rham cohomology (Betti numbers) and Killing vectors of the compactification manifold. We find compactifications that control chaos in vacuum Einstein gravity, as well as in string theories with N = 1 supersymmetry and M-theory. In models where chaos is controlled in this way, the universe can remain homogeneous and flat until it enters the quantum gravity regime. At this point, the classical equations leading to chaotic behavior can no longer be trusted, and quantum effects may allow a smooth approach to the big crunch and transition into a subsequent expanding phase. Our results may be useful for constructing cosmological models with contracting phases, such as the ekpyrotic/cyclic and pre-big bang models.