The measurement of the charge asymmetry in top quark pair events with highly Lorentz-boosted top quarks decaying to a single lepton and jets is presented. The analysis is performed using proton-proton collisions at s=13TeV with the CMS detector at the LHC and corresponding to an integrated luminosity of 138 fb−1. The selection is optimized for top quarks produced with large Lorentz boosts, resulting in nonisolated leptons and overlapping jets. The top quark charge asymmetry is measured for events with a tt¯ invariant mass larger than 750 GeV and corrected for detector and acceptance effects using a binned maximum likelihood fit. The measured top quark charge asymmetry of (0.42−0.69+0.64)% is in good agreement with the standard model prediction at next-to-next-to-leading order in quantum chromodynamic perturbation theory with next-to-leading-order electroweak corrections. The result is also presented for two invariant mass ranges, 750–900 and >900GeV.