Massive zones of diagenetic carbonate which replace sulfate deposits are observed in the Middle Miocene evaporites in several outcrops along the Egyptian coast of the Gulf of Suez. These carbonates display marked similarities of morphology, lithofacies, and stable isotope composition to diagenetic carbonates described in some portions of Messinian "Gessoso Solfifera" Formation of Sicily and in the "Castiles" of the Upper Permian Castile Formation of the Delaware basin. The mechanism of mineral transformation is basically bacterial sulfate reduction because the low delta 13 C values of these carbonates argue for the organic origin of carbon. The delta 18 O values fall into two distinct groupings, indicating that the carbonates were crystallized during two different diagenetic stages. The early diagenetic stage occurred soon after deposition, in pore waters of marine origin and at different levels of evaporation; organic matter used by bacteria was produced in situ. The late diagenetic stage occurred when the tectonic or halokinetic uplift of the sequence caused flushing of the sediments by groundwaters of the phreatic aquifer and hydrocarbon migration. Furthermore, to explain the very low delta 18 O values of these carbonates, it is inferred that locally ambient temperatures reached more than 35 degrees C due to the large quantities of energy released during the bacterial sulfate reduction.