The Oligocene–Miocene Asmari Formation is a sequence of shallow-water carbonate carbonates in the Zagros Basin. This formation is a significant oil reservoir that was formed in the Zagros foreland basin in southwestern Iran. The Razan section, located in the northwest of Zagros in the Lorestan province, was investigated to study microfacies types and evaluate the sedimentary environment. This section was then compared with the MakhmalKuh and Dehloran sections. It comprises limestone units with thin to medium strata, sometimes thick-bedded limestone, and other skeletal and non-skeletal components. Based on the biostratigraphy studies, 24 foraminifer genera and species have been identified. Among the foraminifera, the species of Peneroplis farsensis, Peneroplis evolutus, Austrotrilina howchini, Austrotrilina asmarensis, Dendritinarangi, Quinqueloculina sp., Triloculina trigonula, Pyrgo sp., Polymorphinids, Spiroluculina sp. and Meandropsina anahensis are the most important specimens. Based on identified co-occurrence taxa, the Austrotrilina howchini–Peneroplis evolutus assemblage zone has been recognised in the study area, which indicates early Miocene (Aquitanian). Texture analysis and faunal assemblages led to the recognition of fourteen microfacies. Based on the petrographic analysis, five depositional settings were determined in the studied section: (a) the outer ramp settings dominated by pelagic foraminifera, bryozoan, echinoid and benthic foraminifera such as Nummulites, Rotalia, Dendritina and Meandropesina iranica as a proxy for relatively deep marine conditions; (b) the mid ramp, characterised by sizeable perforate foraminifera such as Amphistegina, Operculina, Heterostegina and planktonic foraminifera; (c) the barrier, marginal marine environment dominated by foraminifera such as Miogypsinoides sp., Peneroplis, Meandropsina, Dendritina and Neoalveolina, as well as peloid and corallinacean algae; (d) the lagoon dominated by benthic foraminifera Austrotrillina, Dendritina, Peneroplis, Miogypsinoides, Borelis, Archaias, miliolids and red algae and (e) the tidal flat, the shallowest part of the inner ramp, dominated by fenestral dolo-mudstone without any fossils. The faunal assemblages represent warm tropical waters under euphotic and mesophotic conditions in a homoclinal ramp.