The four-lepton (4, = e,μ) 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 √s = 8 TeV collected with the ATLAS detector at the LHC. The 4 events are produced in the decays of resonant Z and Higgs bosons and the non- resonant Z Z continuum originating from qq ̄, gg, and qg initial states. A total of 476 signal candidate events are observed with a background expectation of 26.2 ± 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 qq ̄ 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 μgg = 2.4 ± 1.0 (stat.) ± 0.5 (syst.) ± 0.8 (theory).