Non-linear dynamics creates vortical currents when the tight-coupling approximation between photons and baryons breaks down around the time of recombination. This generates a magnetic field at second order in cosmological perturbations, whose power spectrum is fixed by standard physics, without the need for any ad hoc assumptions. We present the fully general relativistic calculation of the magnetic power spectrum, including the effects of metric perturbations, second-order velocity and photon anisotropic stress, thus generalizing and correcting previous results. We also show that significant magnetogenesis continues to occur after recombination. The power spectrum decays as k4 on large scales, and grows as k0.5 on small scales, down to the limit of our numerical computations, ∼1 Mpc. On cluster scales, the created field has a strength of ∼3 × 10−29 G.