Context. The Yarkovsky effect is a weak non-gravitational force but may significantly affect subkilometer-sized near-Earth asteroids. Yarkovsky-related drift may be detected, in principle, from astrometric or radar datasets of sufficient duration. To date, the asteroid Kamo'oalewa, the most stable of Earth's quasi-satellites, has an ∼ 18 year-long arc of ground-based optical astrometry. These data provide an opportunity to detect the Yarkovsky effect acting on the asteroid Kamo'oalewa. Aims. We determined the Yarkovsky-related drift of asteroid Kamo'oalewa from ∼ 18 years of ground-based optical astrometry. Furthermore, we investigated the influence of the Yarkovsky effect on the orbital evolution of asteroid Kamo'oalewa based on this estimated value, and evaluated the potential improvements in the detection of non-gravitational accelerations (Yarkovsky effect and solar radiation pressure) for the asteroid Kamo'oalewa that could be provided by the future Chinese small-body exploration mission, Tianwen-2. Methods. The Yarkovsky-related drift of asteroid Kamo'oalewa was detected from the orbital fitting of the astrometry measurements. We checked the Yarkovsky effect detection based on both the orbit fitting results and the physical mechanisms of the Yarkovsky effect. Results. We report for the first time the detection of the Yarkovsky effect acting on asteroid Kamo'oalewa based on ∼ 18 years of ground-based optical astrometry data. The estimated semi-major axis drift is (-6.155 ± 1.758) × 10 −3 au/Myr. In addition, our numerical simulation shows that the Yarkovsky effect has almost no influence on the short-term orbital evolution of the asteroid Kamo'oalewa, but does have a long-term influence, by delaying the entry of the object into the Earth co-orbital region and accelerating its exit from this region, with a more significant signature on the exit than on the entry. In the context of spacecraft tracking data, the Tianwen-2 mission will improve both non-gravitational accelerations (Yarkovsky effect and solar radiation pressure) and predictions of its future ephemeris.