A measurement is presented of the ZZ production cross section in the ZZ → 2ℓ2ℓ′ decay mode with ℓ = e, μ and ℓ′ = e, μ, τ in proton-proton collisions at s√=7 TeV with the CMS experiment at the LHC. Results are based on data corresponding to an integrated luminosity of 5.0 fb−1. The measured cross section σ(pp→ZZ)=6.24+0.86−0.80(stat.)+0.41−0.32(syst.)±0.14(lumi.)pb is consistent with the standard model predictions. The following limits on ZZZ and ZZγ anomalous trilinear gauge couplings are set at 95% confidence level: −0.011<fZ4<0.012,−0.012<fZ5<0.012,−0.013<f\upgamma4<0.015 , and −0.014<f\upgamma5<0.014 .