This paper describes the search for a high-mass narrow-width scalar particle decaying into a Z boson and a photon. The analysis is performed using proton-proton collision data recorded with the CMS detector at the LHC at center-of-mass energies of 8 and 13 TeV, corresponding to integrated luminosities of 19.7 and 2.7 fb−1, respectively. The Z bosons are reconstructed from opposite-sign electron or muon pairs. No statistically significant deviation from the standard model predictions has been found in the 200-2000 GeV mass range. Upper limits at 95% confidence level have been derived on the product of the scalar particle production cross section and the branching fraction of the Z decaying into electrons or muons, which range from 280 to 20 fb for resonance masses between 200 and 2000 GeV.