One of the challenges of 3D geological modelling is the spatial representation of heterogeneous sedimentary rocks. The R’Mel coastal basin located in northwestern Morocco is a very suitable area for the modelling of sedimentary rock formations. This basin is part of the external Pre-Rif area and is composed of rocks of Miocene to Quaternary age (principally sand, marl, sandstone, silt, and alluvia). Due to the impact of climate change, any increase in the abstraction of groundwater can accentuate its vulnerability to marine water intrusion. Therefore, understanding of geometry of this aquifer is so important. To achieve this, a 3D geological model was developed to determine the different HydroGeological Units (HGUs) of the R’Mel aquifer. The processing and the construction of a GIS database including a detailed geological map, 125 boreholes, and 50 vertical electrical soundings (VESs), as well as the development of five geological cross-sections, helped build this model using 3D modelling software. The model provides a detailed visualization of the spatial distribution of the eight HGUs. HGUs 3 and 6 consist of marly-clayey lenses and five HGUs of Plio-Quaternary age are composed of: sand or/and sandstone (HGU 1), calcarenites and lumachelles (HGU 2), sandstone and/or shelly marine sand (HGU 4), gravel with a sandy-clayey matrix (HGU 5), and shelly sandstone and gravelly sand (HGU 7). The eighth layer (HGU 8) is composed of marls and clays of Miocene age. The generation of several geological sections from the model made it possible to identify anticlines, synclines and faults trending NNW–SSE and NNE–SSW. Theses, support the tectonics of the Gharb basin during the Mio-Plio-Quaternary. Finally, a conceptual model of the R’Mel aquifer was developed.