The Upper Jurassic carbonates of the eastern part of the Kopet-Dagh Basin, with thickness of 470 m, are the major gas-bearing reservoir in NE Iran. The objectives of this study are recognition of diagenetic history and estimation of porosity related to dolomitization. Based on field and laboratory study, four carbonate facies associations have been identified at the Mazdavand outcrop. Most of the carbonate rocks were deposited in an open marine, tidal channel and barrier, lagoon and tidal flat setting. Using petrographic and CL analyses, the main diagenetic processes that affected these rocks are micritization, cementation, compaction, fracturing, dissolution, neomorphism, silicification, and dolomitization. Dissolution of grains and calcite cement generated secondary porosity, whereas compaction and cementation are the primary cause of porosity reduction. The average porosity of core plugs is 15.78% and match well with two-dimensional estimates from thin sections. The more porous samples are either highly fractured or contain interparticle and intercrystalline porosity, within the lower strata that contain more dolostone.