A mixed carbonate-clastic sequence is one of several Miocene hydrocarbon-bearing reservoirs in the northwestern Sabah Basin. This sequence consists of bioclast-rich sandstones interpreted as prograding storm shoal deposits. The sequence contains a complex variety of carbonate nodules.The sequence has undergone nine stages of cementation that completely occluded pores. Each stage represents a distinctive cement texture, precipitating at specific temperatures and burial conditions. The diagenetic evolution began with a syndepositional iron-free marine calcite (Ca1), followed by an early methane-derived dolomite (Do1), bladed calcite (Ca2), blocky, vein-filling Fe-calcites (Ca3Ca4, clay mineral-associated dolomite (Do2), Fe-dolomite and ankerite (Do3Do4, and late iron-rich calcite (Ca5). Each stage of cement has distinctive Sr2+, Mn2+, Mg2+, Fe2+, Ca2+, and Na+ contents, reflecting changes in the palaeo-porefluid systems with time. The cements are correlatable over the whole study area.Precipitation occurred from very early to late stages of diagenesis at near surface to 2.0 km depths. With progressive burial and temperature increase, oxygen isotope values become strongly negative (stage Ca4: δ13C = −0.5%. PDB, δ18O = −5.7%. PDB). The cements were precipitated at 20–75°C. The source of carbon varies from marine dissolved carbonates to fermentation of organic matter, methane, meteoric waters, and possibly hydrothermal fluids.Strontium isotope dating of Do1 (with δ13C = −32.5%. PDB, δ18O = +2.60%. PDB) and Do2 (δ13C = 3.0%. PDB; δ18O = −2.5%. PDB) dolomites indicates that these dolomitization events took place at 10.5 Ma and 8.9 Ma, respectively, assuming precipitation within a completely open seawater system. The Do1 dolomite was precipitated from a methane-derived brine at the boundary between the Serravallian and Tortonian stages after major uplift, and induced faulting, at a sea-level lowstand. The Do2 dolomite was precipitated during intermediate to deep burial diagenesis during smectite-illite transformation before hydrocarbon emplacement.