SummaryThe longitudinal seismic response of a long tunnel subjected to Rayleigh waves is investigated in this paper. The tunnel is assumed to be infinitely long, has a uniform cross section, and rests on a viscoelastic foundation. The free‐field deformation under Rayleigh waves traveling parallel to the tunnel axis is decomposed into two directions, namely, the axial motion and the vertical motion, and transformed into dynamic loads imposed on the tunnel. Based on the Fourier and Laplace integral transform techniques, the governing equations of tunnels are simplified into algebraic equations, and the analytical solutions are obtained with the convolution theorem. The final solutions of the tunnel responses in terms of deflection, velocity, acceleration, axial force, bending moment, and shear force are investigated. The proposed solution is verified by comparison of its results and those from the finite element program ABAQUS. Further parametric analysis is carried out to investigate the influence of soil‐structure relative stiffness ratio and wave frequency on dynamic longitudinal responses of the tunnel.