Field, petrographic, and geochemical analyses indicate that the native sulfur at Ras Gemsa is off diagenetic origin. The sulfur formed, together with megacrystalline dolomite (biogenic dolomite) and biogenic calcite, by bacterial action on sulfate in the presence of organic matter (hydrocarbons). The sulfur occurs in an uplifted horst block consisting of evaporite-carbonate rocks overlying the middle Miocene oil- and gas-bearing strata. The evaporite deposits are interpreted to be a composite sequence that includes deposits of shallow lagoonal (subaqueous) and supratidal (sabkha) environments. Two types of dolomite (microcrystalline and megacrystalline) are recognized in the studied sequence. Stable isotope data showed that the microcrystalline dolomite has high δ18O values (mean = +1.05‰ PDB) and relatively low δ13C values (mean = -3.2‰ PDB). These results indicate that the microcrystalline dolomite was deposited mainly under marine evaporitic conditions. The megacrystalline dolomite is characterized by negative δ18O values (mean = -6.8‰ PDB) and strongly negative δ13C values (mean = -24.05‰ PDB). The negative δ18O values are probably due to the effect of hot conditions or depleted meteoric water and/or biological effects during dolomite crystallization. The negative δ13C values signify the important role played by the sulfate-reducing bacteria in the presence of organic matter.