When quartz-rich sands are buried and heated, pore space is gradually filled by precipitation of quartz cement from aqueous formation fluids. Here we examine whether the presence of oil in the pore space can retard or halt this loss of porosity by slowing or stopping quartz cementation. The effect of oil fill on quartz cementation is examined by using the distribution of quartz cement in the Brae Formation deep-water sandstone reservoir of the Miller oil field (North Sea). Petrographic data demonstrate that sandstones from the oil zone have much less quartz cement, and more porosity, than sandstones from the water zone. Sandstones in both oil and water zones are compositionally and texturally identical and have been affected by a similar burial history. Kinetic modeling of the cementation process suggests that progressive oil charging has slowed quartz-cement growth rates by at least two orders of magnitude, halting it completely in the most extreme cases. Our data demonstrate that early oil charging in the crestal part of an anticline can preserve porosity in deeply buried sandstones. This knowledge is especially relevant to porosity prediction for petroleum exploration in deeply buried sandstones.