Self-bound many-body systems are formed through a balance of attractive and repulsive forces and occur in many physical scenarios. Liquid droplets are an example of a self-bound system, formed by a balance of the mutual attractive and repulsive forces that derive from different components of the inter-particle potential. It has been suggested that self-bound ensembles of ultracold atoms should exist for atom number densities that are 10^8 times lower than in a helium droplet, which is formed from a dense quantum liquid. However, such ensembles have been elusive up to now because they require forces other than the usual zero-range contact interaction, which is either attractive or repulsive but never both. On the basis of the recent finding that an unstable bosonic dipolar gas can be stabilized by a repulsive many-body term, it was predicted that three-dimensional self-bound quantum droplets of magnetic atoms should exist. Here we report the observation of such droplets in a trap-free levitation field. We find that this dilute magnetic quantum liquid requires a minimum, critical number of atoms, below which the liquid evaporates into an expanding gas as a result of the quantum pressure of the individual constituents. Consequently, around this critical atom number we observe an interaction-driven phase transition between a gas and a self-bound liquid in the quantum degenerate regime with ultracold atoms. These droplets are the dilute counterpart of strongly correlated self-bound systems such as atomic nuclei and helium droplets.