A measurement of the ZZ production cross section in proton-proton collisions at sqrt[s] = 7 TeV using data corresponding to an integrated luminosity of 1.02 fb(-1) recorded by the ATLAS experiment at the LHC is presented. Twelve events containing two Z boson candidates decaying to electrons and/or muons are observed, with an expected background of 0.3 ± 0.3(stat)(-0.3)(+0.4)(syst) events. The cross section measured in a phase-space region with good detector acceptance and for dilepton masses within the range 66 to 116 GeV is σ(ZZ → ℓ+ ℓ- ℓ+ ℓ-)(fid) = 19.4(-5.2)(+6.3)(stat)(-0.7)(+0.9)(syst) ± 0.7(lumi) fb. The resulting total cross section for on-shell ZZ production, σ(ZZ)(tot) = 8.5(-2.3)(+2.7)(stat)(-0.3)(+0.4)(syst) ± 0.3(lumi) pb, is consistent with the standard model expectation of 6.5(-0.2)(+0.3) pb calculated at the next-to-leading order in QCD. Limits on anomalous neutral triple gauge boson couplings are derived.