Quartz is an important, porosity-occluding cement in sandstone reservoirs that have been subjected to elevated temperature (>80°C to 100°C) for a substantial period of time. The effect of oil emplacement on quartz cementation in reservoir sandstones is controversial; some studies have concluded that early oil emplacement can inhibit quartz cementation, leading to the preservation of porosity, whereas other studies have concluded that quartz cementation appears largely unaffected by oil emplacement. Here we have studied shallow marine, Upper Jurassic sandstones from Ula field, Norwegian North Sea, with reservoir temperatures of approximately 150°C, to determine whether oil emplacement had a significant impact on diagenesis with particular attention to quartz cementation. Following sedimentological description of cores, samples above and below the oil–water contact have been collected, adjacent to core-analysis plug points. These samples then underwent a series of studies, including petrographic point counting with a transmitted light microscope, scanning electron microscopy (SEM), backscattered electron microscopy, SEM-cathodoluminescence microscopy, and fluid-inclusion studies. These data were integrated with routine core-analysis and petrophysical log data. Density and resistivity log data have been used to determine the precise oil saturation of each sample studied. The distributions of all potential controls on porosity and permeability, such as grain size, sorting, matrix clay content, and degree of bioturbation, the presence of grain coatings and dolomite cement, and the amount of quartz cement, have been assessed. The presence of primary oil inclusions within quartz cement shows that oil ingress into the Ula reservoir commenced prior to the onset of quartz cementation. Very fine–grained, matrix-rich, bioturbated, microquartz-cemented sandstones have uniformly low quartz-cement contents irrespective of oil saturation. Medium-grained, graded, matrix-poor, microquartz-poor sandstones have quartz cement ranging from 1% to greater than 17%, associated with core porosities of approximately 22% and 7%, respectively. Higher oil saturations equate to higher porosities and permeabilities in the medium-grained, graded, matrix-poor, microquartz-poor sandstones, which cannot be explained by any control other than the amount of quartz cement as a function of pore fluid type. Oil emplacement therefore appears to have inhibited quartz cementation at high oil saturations and can be viewed as an important control on reservoir quality. The significance of this study is that the presence of oil in a sandstone reservoir at the time that quartz cement was growing can have a considerable impact on reservoir quality. Models that seek to predict quartz cement and reservoir quality in sandstones need to account for the timing of oil emplacement compared with other diagenetic processes.