The ecological structure of ancient marine communities is impacted by the environmental gradients controlling assemblage compositions and the heterogeneous distribution of sediment types. Closely spaced, replicate sampling of fauna has been suggested to mitigate the effects of such heterogeneity and improve gradient analyses, but this technique has rarely been combined with similar sampling of lithologic data. This study analyses lithological and faunal data to determine the environmental gradients controlling the composition of Mississippian fossil assemblages of the lower Madison Group in Montana. Eighty-one lithological and faunal samples were collected from four stratigraphic columns in Montana, which represent the deep-subtidal, foreshoal, and ooid-shoal depositional environments within one third-order depositional sequence. Cluster analysis identifies three distinct lithological associations across all depositional environments—crinoid-dominated carbonates, peloidal-crinoidal carbonates, and micritic-crinoidal carbonates. Cluster analysis and nonmetric multidimensional scaling (NMS) identifies a highly diverse brachiopod biofacies and a solitary coral-dominated biofacies along an onshore-offshore gradient. Carbonate point count data and orientation of solitary corals indicate that substrate and wave energy are two potential variables that covary with the onshore-offshore gradient. Overlaying lithological information on the NMS indicates a secondary gradient reflecting oxygen that is expressed by increasing bioturbation and gradation from brown to dark gray carbonates to medium-light gray carbonates. Taken together, these findings demonstrates how combining closely spaced, replicate sampling of lithologic and faunal data enhances multivariate analyses by uncovering underlying environmental gradients that control the variation in fossil assemblages.