This study investigates the controls on three-dimensional stratigraphic geometries and facies of shallow-water carbonate depositional sequences. A 15 km2 area of well-exposed Mid to Late Miocene carbonates on the margin of the Níjar Basin of SE Spain was mapped in detail. An attached carbonate platform and atoll developed from a steeply sloping basin margin over a basal topographic unconformity and an offshore dacite dome (Late Miocene). The older strata comprise prograding bioclastic (mollusc and coralline algae) dominated sediments and later Messinian Porites reefs form prograding and downstepping geometries (falling stage systems tract). Seven depositional sequences, their systems tracts and facies have been mapped and dated (using Sr isotopes) to define their morphology, stratigraphic geometries, and palaeo-environments. A relative sea-level curve and isochore maps were constructed for the three Messinian depositional sequences that precede the late Messinian evaporative drawdown of the Mediterranean. The main 3D controls on these depositional sequences are interpreted as being: (i) local, tectonically driven relative sea-level changes; (ii) the morphology of the underlying sequence boundary; (iii) the type of carbonate producers [bioclastic coralline algal and mollusc-dominated sequences accumulated in lows and on slopes of < 14° whereas the Porites reef-dominated sequence accumulated on steep slopes (up to 25°) and shallow-water highs]. Further controls were: (iv) the inherited palaeo-valleys and point-sourced clastics; (v) the amount of clastic sediments; and (vi) erosion during the following sequence boundary development. The stratigraphy is compared with that of adjacent Miocene basins in the western Mediterranean to differentiate local (tectonics, clastic supply, erosion history, carbonate-producing communities) versus regional (climatic, tectonic, palaeogeographic, sea-level) controls.