A search for a Higgs boson decaying into two photons is described. The analysis is performed using datasets recorded by the CMS experiment at the LHC from pp collisions at a centre-of-mass energies of 7~TeV and 8~TeV. The datasets correspond to an integrated luminosity of 5.1 and 5.3~fb, respectively. Limits are set on the cross section of the standard model Higgs boson decaying to two photons. An excess of events above the expected standard model background is observed for a Higgs boson mass hypothesis of 125~GeV, with a local significance of 4.1. The global significance of observing an excess with a local significance 4.1 anywhere in the search range 110--150~GeV is estimated to be 3.2. This result constitutes evidence for the existence of a new state that decays into two photons.