Broad X-ray emission lines from neutral and partially ionized iron observed in active galaxies have been interpreted as fluorescence produced by the reflection of hard X-rays off the inner edge of an accretion disk. In this model, line broadening and distortion result from rapid rotation and relativistic effects near the black hole, the line shape being sensitive to its spin. Alternative models in which the distortions result from absorption by intervening structures provide an equally good description of the data, and there has been no general agreement on which is correct. Recent claims that the black hole (2 × 10(6) solar masses) at the centre of the galaxy NGC 1365 is rotating at close to its maximum possible speed rest on the assumption of relativistic reflection. Here we report X-ray observations of NGC 1365 that reveal the relativistic disk features through broadened Fe-line emission and an associated Compton scattering excess of 10-30 kiloelectronvolts. Using temporal and spectral analyses, we disentangle continuum changes due to time-variable absorption from reflection, which we find arises from a region within 2.5 gravitational radii of the rapidly spinning black hole. Absorption-dominated models that do not include relativistic disk reflection can be ruled out both statistically and on physical grounds.