More than 30 years ago, Thouless introduced the concept of a topological charge pump that would enable the robust transport of charge through an adiabatic cyclic evolution of the underlying Hamiltonian. In contrast to classical transport, the transported charge was shown to be quantized and purely determined by the topology of the pump cycle, making it robust to perturbations. On a fundamental level, the quantized charge transport can be connected to a topological invariant, the Chern number, first introduced in the context of the integer quantum Hall effect. A Thouless quantum pump may therefore be regarded as a dynamical version of the integer quantum Hall effect. Here, we report on the realization of such a topological charge pump using ultracold bosonic atoms that form a Mott insulator in a dynamically controlled optical superlattice potential. By taking in-situ images of the atom cloud, we observe a quantized deflection per pump cycle. We reveal the genuine quantum nature of the pump by showing that, in contrast to ground state particles, a counterintuitive reversed deflection occurs when particles are prepared in the first excited band. Furthermore, we were able to directly demonstrate that the system undergoes a controlled topological phase transition in higher bands when tuning the superlattice parameters.