Continental deposits of the middle Miocene Barstow Formation formed in an extensional basin of the Mojave region. Mammalian faunas of the type section in the Mud Hills, California, are the basis for defining the Barstovian North American Land Mammal Age. Prior mapping, lithostratigraphy, geochronology, and fossil collecting have established a structural, chronostratigraphic, and biostratigraphic framework for the Barstow Formation. Here, we analyze the sedimentary facies of the lithostratigraphic sequence, infer the major depositional environments, and assess controls on fossil preservation in relation to major facies. We recognize six major facies associations that represent alluvial fans, shallow or seasonal lakes, and channels and floodplains. The transition from older, fan-dominated to younger, floodplain-dominated environments reflects changes in tectonics, accommodation, drainage, and depositional settings during the formation and filling of the basin. Fossil-mammal concentrations are common in four facies associations. Body fossils are abundant in two facies associations that represent well-drained floodplains and spring-fed wetlands. Fossil concentrations are moderately abundant in facies associations that represent floodplains and channel deposits, and fossils are rare in facies associations that represent alluvial fans and lake margins. The highest frequency of fossil localities occurs in the facies associations representing both suitable life habitats and high preservation potential for terrestrial mammals.