We present a new numerical method to determine second-order Lagrangian displacement fields in presence of modified gravity (MG). We start from the extension of Lagrangian perturbation theory (LPT) to a class of MG models, which can be described by a parametrized Poisson equation. We exploit Fast Fourier transforms to compute the full source term of the differential equation for the second-order Lagrangian displacement field. We compare its mean to the source term computed for specific configurations, for which a k-dependent solution can be found numerically. We choose the configuration that best matches the full source term, thus obtaining an approximate factorization of the second-order displacement field as the space term valid for Λ Cold Dark Matter (ΛCDM) times a k-dependent, second-order growth factor. Such approximation is used to compute second-order displacements for particles. The method is tested against N-body simulations run with standard and f(R) gravity: we rely on the results of a friends-of-friends code run on the N-body snapshots to assign particles to haloes, then compute the halo power spectrum. We find very consistent results for the two gravity theories: second-order LPT (2LPT) allows to recover the N-body halo power spectrum within ∼10 per cent precision to k ∼ 0.2–0.4 h Mpc−1, as well as halo positions. We show that the performance of 2LPT with MG is the same (within 1 per cent) as the one obtained for standard ΛCDM case. This formulation of 2LPT can quickly generate dark matter distributions with f(R) gravity, and can easily be extended to other MG theories.