The uppermost 50 km of the lithospheric structure of the northern part of the Iberian Peninsula is presented in this study, by means of a set of 2D images of shear-wave velocity for depths raging from 0 to 50 km. This goal will be attained by means of the inversion of the Rayleigh-wave dispersion. For this purpose, the 23 earthquakes occurred on the vicinity of the study area, from 2001 to 2003, will be considered. The dispersion curves of these earthquakes have been measured for periods from 2 to 45 s, by combination of two digital-filtering techniques: Multiple Filter Technique (MFT) and Time Variable Filtering (TVF). The resulting set of source-station averaged dispersion curves has been inverted according to the generalized inversion theory, to get S-wave velocity models for each source-station path. Finally, these models have been interpolated by kriging to obtain a 2D mapping of the S-wave velocity structure, for the northern part of Iberia. The results presented in this paper show that the crust of the study area consisted of three main layers of varying thickness with a clear S-velocity contrast, resulting in a Moho depth of 30 km that decreases to 25 km in the eastern border of the Iberian peninsula and to 20 km in the Valencia trough. The upper crust has a sedimentary cover of 2 km thick. This upper crust has a thickness of 8 km, showing a very small lateral variation. In the middle crust (from 10 to 20 km depth), the S-velocity increases from 3.4 km/s to 3.7 km/s for the whole study area except for the east and the Valencia trough, where the S-velocities reach values of 3.9 km/s. The lower crust (from 20 to 30 km depth), exhibits S-velocities of 3.8–3.9 km/s, which jump to 4.3–4.7 km/s in the upper mantle.