This paper deals with the genesis of the carbonate cements in the Bajocian–Bathonian sandstones of Wadi El-Giddi sequence, Central Sinai, Egypt. The recorded cements comprise four carbonate minerals: dolomite, calcite, ankerite and siderite. The emplacement of these cements is ascribed to two diagenetic stages; early shallow marine/meteoric stage and late mesogenetic burial stage. The variations in the chemistry of the precipitated porewater, timing of precipitation and burial history of the rock sequence are reflected in the variation in the texture, mineralogy, geochemical and stable isotopic compositions of the diagenetic cements.The microcrystalline non-stoichiometric calcian dolomite was probably formed in early diagenetic stage from marine-dominated mixed fluid after the invasion of meteoric water into the shallow marine sandstones and mixed with the marine water. This is evidenced from the typical marine δ18O (31.7 to 32.2‰, VSMOW) values and moderate Sr (av. 376ppm) content. Meanwhile, the relatively high Sr (av. 565ppm), Fe (av. 3.3mol%) and Mn (av. 0.48mol%) contents, low Mg content (av. 1.3mol%) and low δ18O (22.0 to 22.7‰, SMOW) values of the calcite cement reveal that it might be formed as a result of stabilization of early diagenetic marine metastable CaCO3 mineral by the effect of fluids of relatively warm meteoric-dominated composition and rich in Fe and Mn during shallow burial diagenesis.On the other hand, the high 18O-depleted signature, high Fe and Mg contents, the coexistence of chalcopyrite, sphalerite and Ti-oxide minerals and the fluid inclusion data suggest that the late replacive carbonate cements including ankerite and siderite, in addition to the coarse crystalline dolomite have been formed in burial conditions during a mesogenetic phase via the replacement of early diagenetic carbonate cement by the influence of hydrothermal and/or deep formation water.The δ13C values of the carbonate cements (−7.7 to 3.3‰) suggest that the carbonate carbon was derived from inorganic source such as the ambient seawater and dissolution of carbonate allochems encountered within the sandstones with minimum influence of 13C-depleted carbon derived from biogenic degradation of organic matter in shallow depth as in the case of dolomite, or thermal maturation of organic matters during burial as in the case of the other cements.