We report the measurement of γγ→ηc(1S),ηc(2S)→η′π+π- with η′ decays to γρ and ηπ+π- using 941 fb-1 of data collected with the Belle detector at the KEKB asymmetric-energy e+e- collider. The ηc(1S) mass and width are measured to be M=[2984.6±0.7 (stat)±2.2 (syst)±0.3 (model)] MeV/c2 and Γ=[30.8-2.2+2.3 (stat)±2.5 (syst)±1.4 (model)] MeV, respectively. First observation of ηc(2S)→η′π+π- with a significance of 5.5σ including systematic error is obtained, and the ηc(2S) mass is measured to be M=[3635.1±3.7 (stat)±2.9 (syst)±0.4 (model)] MeV/c2. The products of the two-photon decay width and branching fraction (B) of decays to η′π+π- are determined to be ΓγγΓγγB=[65.4±2.6 (stat)±7.8 (syst)] eV for ηc(1S) and [5.6-1.1+1.2 (stat)±1.1 (syst)] eV for ηc(2S). The cross sections for γγ→η′π+π- and η′f2(1270) are measured for the first time.