Soil microbial communities are affected by interactions between agricultural management (e.g., fertilizer) and soil compartment, but few studies have considered combinations of these factors. We compared the microbial abundance, diversity and community structure in two fertilizer dose (high vs. low NPK) and soil compartment (rhizosphere vs. bulk soils) under 6-year fertilization regimes in a continuous garlic cropping system in China. The soil contents of NO3– and available K were significantly higher in bulk soil in the high-NPK. The 16S rRNA gene-based bacterial and archaeal abundances were positively affected by both the fertilizer dose and soil compartment, and were higher in the high-NPK fertilization and rhizosphere samples. High-NPK fertilization increased the Shannon index and decreased bacterial and archaeal richness, whereas the evenness was marginally positively affected by both the fertilizer dose and soil compartment. Soil compartment exerted a greater effect on the bacterial and archaeal community structure than did the fertilization dose, as demonstrated by both the nonmetric multidimensional scaling and redundancy analysis results. We found that rhizosphere effects significantly distinguished 12 dominant classes of bacterial and archaeal communities, whereas the fertilizer dose significantly identified four dominant classes. In particular, a Linear Effect Size analysis showed that some taxa, including Alphaproteobacteria, Rhizobiales, Xanthomonadaceae and Flavobacterium, were enriched in the garlic rhizosphere of the high-NPK fertilizer samples. Overall, the fertilizer dose interacted with soil compartment to shape the bacterial and archaeal community composition, abundance, and biodiversity in the garlic rhizosphere. These results provide an important basis for further understanding adaptive garlic-microbe feedback, reframing roots as a significant moderating influence in agricultural management and shaping the microbial community.