We describe global, 3D, time-dependent, non-radiative, general-relativistic, magnetohydrodynamic simulations of accreting black holes (BHs). The simulations are designed to transport a large amount of magnetic flux to the centre, more than the accreting gas can force into the BH. The excess magnetic flux remains outside the BH, impedes accretion, and leads to a magnetically arrested disc. We find powerful outflows. For a BH with spin parameter a = 0.5, the efficiency with which the accretion system generates outflowing energy in jets and winds is η≈ 30 per cent. For a = 0.99, we find η≈ 140 per cent, which means that more energy flows out of the BH than flows in. The only way this can happen is by extracting spin energy from the BH. Thus the a = 0.99 simulation represents an unambiguous demonstration, within an astrophysically plausible scenario, of the extraction of net energy from a spinning BH via the Penrose–Blandford–Znajek mechanism. We suggest that magnetically arrested accretion might explain observations of active galactic nuclei with apparent η≈ few × 100 per cent.