Locally abundant and diverse brachiopod faunas, associated with unstable outer shelf and slope environments, occur throughout the Barr and Ardmillan groups (middle Llanvirn–upper Ashgill) in the Girvan district of SW Scotland. A dataset of 350 brachiopod species from 30 horizons through the Middle–Upper Ordovician succession forms the basis for a description of brachiopod diversity through the succession and comparison with global patterns and trends through this time interval. The Middle Ordovician Barr Group incorporates shallow water carbonate and clastic facies, characterised by Valcourea confinis, with deeper-water facies. The trilobite-dominated Albany Group preserves outer shelf biofacies. Deep-water facies occur in the Balclatchie Formation of the lower Ardmillan Group, including an early occurrence of a Foliomena-type species. High diversity brachiopod faunas occur in clastic facies, though many of the biofacies have a transported component to them. Representatives of the deep-water Foliomena fauna occur intermittently throughout the Upper Ardmillan Group, appearing in both the Whitehouse and Drummuck subgroups. This distinctive assemblage of small, thin-shelled brachiopods, including Dedzetina, Christiania, Cyclospira and Foliomena itself, is interbedded with a variety of other less cosmopolitan deep-water assemblages, including the Onniella–Skenidioides and Lingulella–Trimurellina associations. Shallower-water environments in the middle Ashgill Lower Drummuck Subgroup hosted the Fardenia–Eopholidostrophia association in sands, and the Christiania–Leptaena association in muds and silts. The remarkable Lady Burn Starfish Beds in the upper part of the group contain a variety of brachiopod-dominated assemblages, including the Eochonetes and Plaesiomys–Schizophorella associations, transported from various shelf locations, within a very diverse mid Ashgill biota. The upper Ashgill High Mains Formation contains abundant elements of the terminal Ordovician Hirnantia fauna, including Eostropheodonta, Hindella and Hirnantia itself, but also some taxa more typical of the Laurentian Edgewood Province. As a whole, the changing brachiopod biodiversity biofacies reflect environmental fluctuations, on this part of the Laurentian margin, driven by mainly eustatic and tectonic events against a background of global biotic radiation.