Accretion of gas onto black holes is thought to power the relativistic jets of material ejected from active galactic nuclei (AGN) and the 'microquasars' located in our Galaxy. In microquasars, superluminal radio-emitting features appear and propagate along the jet shortly after sudden decreases in the X-ray fluxes. This establishes a direct observational link between the black hole and the jet: the X-ray dip is probably caused by the disappearance of a section of the inner accretion disk as it falls past the event horizon, while the remainder of the disk section is ejected into the jet, creating the appearance of a superluminal bright spot. No such connection has hitherto been established for AGN, because of insufficient multi-frequency data. Here we report the results of three years of monitoring the X-ray and radio emission of the galaxy 3C120. As has been observed for microquasars, we find that dips in the X-ray emission are followed by ejections of bright superluminal knots in the radio jet. The mean time between X-ray dips appears to scale roughly with the mass of the black hole, although there are at present only a few data points.