Active galactic nuclei and quasars are thought to be scaled-up versions of Galactic black hole binaries, powered by accretion onto supermassive black holes with masses of 106-109 M⊙, as opposed to the ∼10 M⊙ in binaries (here M⊙ is the solar mass). One example of the similarities between these two types of systems is the characteristic rapid X-ray variability seen from the accretion flow. The power spectrum of this variability in black hole binaries consists of a broad noise with multiple quasi-periodic oscillations superimposed on it. Although the broad noise component has been observed in many active galactic nuclei, there have hitherto been no significant detections of quasi-periodic oscillations. Here we report the discovery of an ∼1-hour X-ray periodicity in a bright active galaxy, RE J1034+396. The signal is highly statistically significant (at the 5.6σ level) and very coherent, with quality factor Q > 16. The X-ray modulation arises from the direct vicinity of the black hole.