The Lonely Bay Formation, located to the west of Great Slave Lake, Northwest Territories, Canada, is a thick-bedded limestone succession that includes four facies that are characteristic of a Devonian middle-ramp depositional setting. One facies in the Lonely Bay Formation is intensely bioturbated with some burrows filled with calcite and others with dolomite. The calcite-filled burrows are found close to the paleo-shoreline of the Canadian Shield, whereas the dolomite-filled burrows are found in deeper ramp deposits. In the calcite-filled burrows the parent burrows, each surrounded by a diagenetic halo, are readily apparent, whereas the dolomite-filled burrows are largely devoid of original structures. Each burrow type has its own distinctive geochemical suites of rare-earth-elements (REE), trace-elements, and δ18O(PDB) and δ13C(PDB) isotopes. These data indicate that sulfate-reducing bacteria, reducing conditions, and marine organic matter were present in the dolomite-filled burrows. Conversely, geochemical data from the calcite-filled burrows indicate that they remained in suboxic conditions and contained little to no marine organic matter that would have contributed to the formation of early dolomite. For these burrows, continent-derived organic matter may have hindered dolomite formation. The contrast between the two types of burrows clearly shows how the different diagenetic environments influenced the evolution of the carbonate. This study, based on interpretations of various geochemical signatures, highlights the roles that oxygen concentrations and types of organic matter (continental versus marine derived) played in dolomite precipitation.