The lower member of the Middle Jurassic Xishanyao Formation (J2x1+2) sandstones are significant exploratory targets for hydrocarbon resources in the Taibei Sag of the Turpan-Hami Basin, northwestern China. Formation of anomalously high porosity/permeability in deeply buried J2x1+2 sandstones and reservoir quality prediction were investigated using a variety of petrographic analyses. These results show that the J2x1+2 sandstones are mostly feldspathic litharenites and litharenites, which are characterized by moderate-to good sorting, silty to medium granularity, and point- to long grain contacts. The J2x1+2 sandstone has low porosity (avg 6.0%) and permeability (avg 1.12 mD), but shows anomalously high porosity/permeability at depth interval of 3850–4050 m. There is a noticeable variation in pore types and sizes from intergranular-intragranular dissolution pores with a size mode of 2.0 μm in anomalously high porosity (AHP) sandstones, to major intragranular dissolution pores with a size mode of 0.5 μm in normally high porosity (NHP) sandstones, to most micropores with a size mode of 0.25 μm occurred in the normally low porosity (NLP) sandstones. The compaction is the main cause of porosity destruction, resulting in an average porosity loss of 89.6%. However, the authigenic minerals have relatively little influence on reservoir quality. The combination of nappe tectonics and well-sorted particles alleviated the compaction and thus preserved more intergranular pores in the AHP sandstones. Dissolution further increases the porosity and eventually forms the AHP sandstones. The strong carbonate-cemented facies (SCC), tightly compacted facies (TC), moderately compacted with moderate dissolution facies (MCMD), and weakly compacted with strong dissolution facies (WCSD) are determined in the J2x1+2 sandstones. The sandstones with SCC and TC are recognized as the NLP reservoirs. The MCMD and WCSD correspond to the NHP and AHP reservoirs, respectively. The reservoir quality predicted using the constructed diagenetic facies charts is in good agreement with the photomicrograph observations and physical property tests. Additionally, the AHP reservoirs are still developed in the deeply buried sandstones with depths larger than 4000 m.