  The four-lepton ($4\ell$, $\ell = e, \mu$) production cross section is
measured in the mass range from 80 to 1000 GeV using 20.3 fb$^{-1}$ of data in
$pp$ collisions at $\sqrt{s}=8$ TeV collected with the ATLAS detector at the
LHC. The $4\ell$ events are produced in the decays of resonant $Z$ and Higgs
bosons and the non-resonant $ZZ$ continuum originating from $q\bar q$, $gg$,
and $qg$ initial states. A total of 476 signal candidate events are observed
with a background expectation of $26.2 \pm 3.6$ events, enabling the
measurement of the integrated cross section and the differential cross section
as a function of the invariant mass and transverse momentum of the four-lepton
system.
  In the mass range above $180$ GeV, assuming the theoretical constraint on the
$q\bar q$ production cross section calculated with perturbative NNLO QCD and
NLO electroweak corrections, the signal strength of the gluon-fusion component
relative to its leading-order prediction is determined to be $\mu_{gg}=2.4 \pm
1.0 (stat.) \pm 0.5 (syst.)\pm 0.8 (theory)$.
