We derive strain-gradient plasticity from a nonlocal phase-field model of dislocations in a plane. Both a continuous energy with linear growth depending on a measure which characterizes the macroscopic dislocation density and a nonlocal effective energy representing the far-field interaction between dislocations arise naturally as scaling limits of the nonlocal elastic interaction. Relaxation and formation of microstructures at intermediate scales are automatically incorporated in the limiting procedure based on Γ-convergence.