The Haldane model on a honeycomb lattice is a paradigmatic example of a Hamiltonian featuring topologically distinct phases of matter. It describes a mechanism through which a quantum Hall effect can appear as an intrinsic property of a band structure, rather than being caused by an external magnetic field. Although physical implementation has been considered unlikely, the Haldane model has provided the conceptual basis for theoretical and experimental research exploring topological insulators and superconductors. Here we report the experimental realization of the Haldane model and the characterization of its topological band structure, using ultracold fermionic atoms in a periodically modulated optical honeycomb lattice. The Haldane model is based on breaking both time-reversal symmetry and inversion symmetry. To break time-reversal symmetry, we introduce complex next-nearest-neighbour tunnelling terms, which we induce through circular modulation of the lattice position. To break inversion symmetry, we create an energy offset between neighbouring sites. Breaking either of these symmetries opens a gap in the band structure, which we probe using momentum-resolved interband transitions. We explore the resulting Berry curvatures, which characterize the topology of the lowest band, by applying a constant force to the atoms and find orthogonal drifts analogous to a Hall current. The competition between the two broken symmetries gives rise to a transition between topologically distinct regimes. By identifying the vanishing gap at a single Dirac point, we map out this transition line experimentally and quantitatively compare it to calculations using Floquet theory without free parameters. We verify that our approach, which allows us to tune the topological properties dynamically, is suitable even for interacting fermionic systems. Furthermore, we propose a direct extension to realize spin-dependent topological Hamiltonians.