Abstract We present the analysis of the extraordinarily bright gamma-ray burst (GRB) 130427A under the hypothesis that the GRB central engine is an accretion-powered magnetar. In this framework, initially proposed to explain GRBs with precursor activity, the prompt emission is produced by accretion of matter on to a newly born magnetar, and the observed power is related to the accretion rate. The emission is eventually halted if the centrifugal forces are able to pause accretion. We show that the X-ray and optical afterglow is well explained as the forward shock emission with a jet break plus a contribution from the spin-down of the magnetar. Our modelling does not require any contribution from the reverse shock, that may still influence the afterglow light curve at radio and mm frequencies, or in the optical at early times. We derive the magnetic field (B ∼ 1016 G) and the spin period (P ∼ 20 ms) of the magnetar and obtain an independent estimate of the minimum luminosity for accretion. This minimum luminosity results well below the prompt emission luminosity of GRB 130427A, providing a strong consistency check for the scenario where the entire prompt emission is the result of continuous accretion on to the magnetar. This is in agreement with the relatively long spin period of the magnetar. GRB 130427A was a well-monitored GRB showing a very standard behaviour and, thus, is a well-suited benchmark to show that an accretion-powered magnetar gives a unique view of the properties of long GRBs.