Under suitable hypotheses, we prove a dynamical version of the Mordell–Lang conjecture for subvarieties of quasiprojective varieties X, endowed with the action of a morphism Φ : X → X . We also prove a version of the Mordell–Lang conjecture that holds for any endomorphism of a semiabelian variety. We use an analytic method based on the technique of Skolem, Mahler, and Lech, along with results of Herman and Yoccoz from nonarchimedean dynamics.