A measurement of W+W− production in pp collisions at √s = 7 TeV is presented. The data were collected with the CMS detector at the LHC, and correspond to an integrated luminosity of 4.92±0.11 fb−1. The W+W− candidates consist of two oppositely charged leptons, electrons or muons, accompanied by large missing transverse energy. The W+W− production cross section is measured to be 52.4 ± 2.0 (stat.) ± 4.5 (syst.) ± 1.2 (lum.) pb. This measurement is consistent with the standard model prediction of 47.0±2.0 pb at next-to-leading order. Stringent limits on the WWγ and WWZ anomalous triple gauge-boson couplings are set.