Facies analysis and paleoenvironmental reconstruction of the Burdigalian to Langhian Asmari Formation, outcropping in the Khorram Abad Anticline, in the north-west of the Zagros Basin allow us to interpret the carbonate ramp history during the Early–Middle Miocene time span. The biota producing sediments in this system are dominated by the rhodalgal and echinofor skeletal-grain associations. Based on the facies distribution and paleoecology of the biotic content, the ramp is divided into three parts: inner, middle and outer ramp. The inner ramp is further subdivided into an inner zone where the main components include imperforate benthic foraminifera and molluscs associated with subordinate coral patch reefs, and an outer shallow-water zone dominated by wackestones–packstones with benthic foraminifera and coralline red algae facies. A shoal belt dominated by coralline red algae, benthic foraminifera, and coral fragments occurs in a distal inner ramp position. The middle ramp is characterized by rhodoliths, crustose red algal wackestone and thinly branching corals associated with encrusting foraminifera in proximal parts, and coralline red algal with larger benthic foraminifera and bryozoan colonies in the deeper oligophotic zone. The outer ramp includes proximal parts dominated by bryozoans, echinoids and molluscs with subordinate planktonic foraminifera and the distal part characterized by planktonic foraminifera and deep epifauna and infauna benthic foraminifera. Changes in trophic conditions and sea-level fluctuations, which are related to tectonic activities, seem to be the important factors in skeletal production and the spatial distribution of carbonate factories.