Quantum criticality is the intriguing possibility offered by the laws of quantum mechanics when the wave function of a many-particle physical system is forced to evolve continuously between two distinct, competing ground states1. This phenomenon, often related to a zero-temperature magnetic phase transition, is believed to govern many of the fascinating properties of strongly correlated systems such as heavy-fermion compounds or high-temperature superconductors1. In contrast to bulk materials with very complex electronic structures, artificial nanoscale devices could offer a new and simpler means of understanding quantum phase transitions2, 3. Here we demonstrate this possibility in a single-molecule quantum dot, where a gate voltage induces a crossing of two different types of electron spin state (singlet and triplet) at zero magnetic field. The quantum dot is operated in the Kondo regime, where the electron spin on the quantum dot is partially screened by metallic electrodes. This strong electronic coupling between the quantum dot and the metallic contacts provides the strong electron correlations necessary to observe quantum critical behaviour. The quantum magnetic phase transition between two different Kondo regimes is achieved by tuning gate voltages and is fundamentally different from previously observed Kondo transitions in semiconductor and nanotube quantum dots4, 5. Our work may offer new directions in terms of control and tunability for molecular spintronics6.