International audienceToday's numerical methods like the Spectral Element Method (SEM) allow accurate simulation of the whole seismic field in complex 3-D geological media. However, the accuracy of such a method requires physical discontinuities to be matched by mesh interfaces. In many realistic earth models, the design of such a mesh is difficult and quite ineffective in terms of numerical cost. In this paper, we address a limited aspect of this problem: an earth model with a thin shallow layer below the free surface in which the elastic and density properties are different from the rest of the medium and in which rapid vertical variations are allowed. We only consider here smooth lateral variations of the thickness and elastic properties of the shallow layer. In the limit of a shallow layer thickness very small compared to the smallest wavelength of the wavefield, by resorting to a second order matching asymptotic approximation, the thin layer can be replaced by a vertically smooth effective medium without discontinuities together with a specific Dirichlet to Neumann (DtN) surface boundary condition. Such a formulation allows to accurately take into account complex thin shallow structures within the SEM without the classical mesh design and time step constraints. Corrections at receivers and source—when the source is located within the thin shallow layer—have been also derived. Accuracy and efficiency of this formulation are assessed on academic tests. The stability and limitations of this formulation are also discussed