A gradient-dependent plasticity theory is applied in finite element solutions of static strain localization problems in two dimensions. Assuming weak satisfaction of constitutive equations a rectangular plane strain/stress element is developed, in which the plastic strain field is discretized in addition to the displacement field. A consistent Newton-Raphson algorithm for this approach is presented. The introduction of an internal length scale makes it possible to obtain mesh objective results and to determine the width of the localization zone. In the examples the attention is confined to strain-softening von Mises plasticity.