The spin of an electron or a nucleus in a semiconductor naturally implements the unit of quantum information--the qubit. In addition, because semiconductors are currently used in the electronics industry, developing qubits in semiconductors would be a promising route to realize scalable quantum information devices. The solid-state environment, however, may provide deleterious interactions between the qubit and the nuclear spins of surrounding atoms, or charge and spin fluctuations arising from defects in oxides and interfaces. For materials such as silicon, enrichment of the spin-zero (28)Si isotope drastically reduces spin-bath decoherence. Experiments on bulk spin ensembles in (28)Si crystals have indeed demonstrated extraordinary coherence times. However, it remained unclear whether these would persist at the single-spin level, in gated nanostructures near amorphous interfaces. Here, we present the coherent operation of individual (31)P electron and nuclear spin qubits in a top-gated nanostructure, fabricated on an isotopically engineered (28)Si substrate. The (31)P nuclear spin sets the new benchmark coherence time (>30 s with Carr-Purcell-Meiboom-Gill (CPMG) sequence) of any single qubit in the solid state and reaches >99.99% control fidelity. The electron spin CPMG coherence time exceeds 0.5 s, and detailed noise spectroscopy indicates that--contrary to widespread belief--it is not limited by the proximity to an interface. Instead, decoherence is probably dominated by thermal and magnetic noise external to the device, and is thus amenable to further improvement.