Electrically charged particles, such as the electron, are ubiquitous. By contrast, no elementary particles with a net magnetic charge have ever been observed, despite intensive and prolonged searches. We pursue an alternative strategy, namely that of realising them not as elementary but rather as emergent particles, i.e., as manifestations of the correlations present in a strongly interacting many-body system. The most prominent examples of emergent quasiparticles are the ones with fractional electric charge e/3 in quantum Hall physics. Here we show that magnetic monopoles do emerge in a class of exotic magnets known collectively as spin ice: the dipole moment of the underlying electronic degrees of freedom fractionalises into monopoles. This enables us to account for a mysterious phase transition observed experimentally in spin ice in a magnetic field, which is a liquid-gas transition of the magnetic monopoles. These monopoles can also be detected by other means, e.g., in an experiment modelled after the celebrated Stanford magnetic monopole search.