The transverse momentum (p(T)) spectrum of prompt D-0 mesons and their antiparticles has been measured via the hadronic decay channels D-0 -> K- pi(+) and (D) over bar (0) -> K+ pi(-) in pp and PbPb collisions at a centre-of-mass energy of 5.02 TeV per nucleon pair with the CMS detector at the LHC. The measurement is performed in the D-0 meson p(T) range of 2-100GeV/c and in the rapidity range of vertical bar y vertical bar < 1. The pp (PbPb) dataset used for this analysis corresponds to an integrated luminosity of 27.4 pb(-1) (530 mu b(-1)). The measured D-0 meson p(T) spectrum in pp collisions is well described by perturbative QCD calculations. The nuclear modification factor, comparing D-0 meson yields in PbPb and pp collisions, was extracted for both minimum-bias and the 10% most central PbPb interactions. For central events, the D-0 meson yield in the PbPb collisions is suppressed by a factor of 5-6 compared to the pp reference in the p(T) range of 6-10GeV/c. For D-0 mesons in the high-p(T) range of 60-100GeV/c, a significantly smaller suppression is observed. The results are also compared to theoretical calculations. (C) 2018 The Author(s). Published by Elsevier B.V.