Using molecules as electronic components is a powerful new direction in the science and technology of nanometre-scale systems. Experiments to date have examined a multitude of molecules conducting in parallel, or, in some cases, transport through single molecules. The latter includes molecules probed in a two-terminal geometry using mechanically controlled break junctions or scanning probes as well as three-terminal single-molecule transistors made from carbon nanotubes, C(60) molecules, and conjugated molecules diluted in a less-conducting molecular layer. The ultimate limit would be a device where electrons hop on to, and off from, a single atom between two contacts. Here we describe transistors incorporating a transition-metal complex designed so that electron transport occurs through well-defined charge states of a single atom. We examine two related molecules containing a Co ion bonded to polypyridyl ligands, attached to insulating tethers of different lengths. Changing the length of the insulating tether alters the coupling of the ion to the electrodes, enabling the fabrication of devices that exhibit either single-electron phenomena, such as Coulomb blockade, or the Kondo effect.