The binary neutron-star (BNS) merger GW170817 is the first celestial object from which both gravitational waves (GWs) and light have been detected enabling critical insight on the pre-merger (GWs) and post-merger (light) physical properties of these phenomena. For the first $sim 3$ years after the merger the detected radio and X-ray radiation has been dominated by emission from a structured relativistic jet initially pointing $sim 15-25$ degrees away from our line of sight and propagating into a low-density medium. Here we report on observational evidence for the emergence of a new X-ray emission component at $delta t>900$ days after the merger. The new component has luminosity $L_x approx 5times 10^{38}rm{erg s^{-1}}$ at 1234 days, and represents a $sim 3.5sigma$ - $4.3sigma$ excess compared to the expectations from the off-axis jet model that best fits the multi-wavelength afterglow of GW170817 at earlier times. A lack of detectable radio emission at 3 GHz around the same time suggests a harder broadband spectrum than the jet afterglow. These properties are consistent with synchrotron emission from a mildly relativistic shock generated by the expanding merger ejecta, i.e. a kilonova afterglow. In this context our simulations show that the X-ray excess supports the presence of a high-velocity tail in the merger ejecta, and argues against the prompt collapse of the merger remnant into a black hole. However, radiation from accretion processes on the compact-object remnant represents a viable alternative to the kilonova afterglow. Neither a kilonova afterglow nor accretion-powered emission have been observed before.