The properties of a Higgs boson candidate are measured in the H to ZZ to 4l decay channel, with l=e,mu, using data from pp collisions corresponding to an integrated luminosity of 5.1 inverse femtobarns at center-of-mass energy of sqrt(s)=7 TeV and 19.7 inverse femtobarns at sqrt(s)=8 TeV, recorded with the CMS detector at the LHC. The new boson is observed as a narrow resonance with a local significance of 6.8 standard deviations, a measured mass of 125.6+/-0.4 (stat.) +/-0.2 (syst.) GeV, and a total width less than 3.4 GeV at a 95% confidence level. The production cross section of the new boson times the branching fraction to four leptons is measured to be 0.93+0.26/-0.23 (stat.) +0.13/-0.09} (syst.) times that predicted by the standard model. Its spin-parity properties are found to be consistent with the expectations for the standard model Higgs boson. The hypotheses of a pseudoscalar and all tested spin-one boson hypotheses are excluded at a 99% confidence level or higher. All tested spin-two boson hypotheses are excluded at a 95% confidence level or higher.