  The magnetospheres of magnetars are believed to be filled with
electron-positron plasma generated by electric discharge. We present a first
direct numerical experiment showing how the plasma is created in an
axisymmetric closed magnetosphere. The $e^\pm$ discharge occurs in response to
twisting of the magnetic field lines by a shear deformation of the magnetar
surface, which launches electric currents into the magnetosphere. The
simulation shows the formation of an electric "gap" with unscreened electric
field ($\mathbf{E}\cdot \mathbf{B}\neq 0$) that continually accelerates
particles along the magnetic field lines and sustains pair creation. The
accelerating voltage is self-regulated to the threshold of the $e^\pm$
discharge. It controls the rate of energy release and the lifetime of the
magnetic twist. The simulation follows the global evolution of the twisted
magnetosphere over a long time and demonstrates its gradual resistive
untwisting. A vacuum cavity forms near the star and expands, gradually erasing
magnetospheric electric currents $j$. The active j-bundle shrinks with time and
its footprints form shrinking hot spots on the magnetar surface bombarded by
the created particles.
