Scanning probe techniques can leverage atomically precise forces to sculpt matter at surfaces, atom by atom. These forces have been applied quasi-statically to create surface structures1–7 and influence chemical processes8,9, but exploiting local dynamics10–14 to realize coherent control on the atomic scale remains an intriguing prospect. Chemical reactions15–17, conformational changes18,19 and desorption20 have been followed on ultrafast timescales, but directly exerting femtosecond forces on individual atoms to selectively induce molecular motion has yet to be realized. Here we show that the near field of a terahertz wave confined to an atomically sharp tip provides femtosecond atomic-scale forces that selectively induce coherent hindered rotation in the molecular frame of a bistable magnesium phthalocyanine molecule. Combining lightwave-driven scanning tunnelling microscopy21–24 with ultrafast action spectroscopy10,13, we find that the induced rotation modulates the probability of the molecule switching between its two stable adsorption geometries by up to 39 per cent. Mapping the response of the molecule in space and time confirms that the force acts on the atomic scale and within less than an optical cycle (that is, faster than an oscillation period of the carrier wave of light). We anticipate that our strategy might ultimately enable the coherent manipulation of individual atoms within single molecules or solids so that chemical reactions and ultrafast phase transitions can be manipulated on their intrinsic spatio-temporal scales.