OBJECTIVES: Common nucleotide-binding oligomerization domain containing 2 (NOD2) gene variants have been associated with bacterial infections (BIs) in cirrhosis, in particular, spontaneous bacterial peritonitis, and mortality. Our aim was to evaluate the independent association of NOD2 variants with BI according to the decompensation stage. METHODS: Consecutive patients with cirrhosis in 2 academic medical centers were included and genotyped for the NOD2 variants p.R702W, p.G908R, and c.3020insC. Electronic medical records were screened for BI (requiring antibiotic therapy) and past and present decompensation (as defined by variceal bleeding, encephalopathy, ascites, and/or jaundice). Clinically significant portal hypertension (CSPH) was assessed with liver stiffness and/or hepatic venous pressure gradient measurements. RESULTS: Overall, 735 patients were recruited (men 65%; interquartile age range 53-68 years). Alcoholic cirrhosis was the predominant etiology (n = 406, 55%), and most patients were in the decompensated stage (n = 531, 72%). In total, 158 patients (21%) carried at least one NOD2 variant. BIs were detected in 263 patients (36%), and NOD2 variants were associated with BI (odds ratio = 1.58; 95% confidence interval 1.11-2.27; P = 0.02). In compensated patients, the combination of NOD2 variants and presence of CSPH was the best independent predictors of BI, whereas other factors, such as spleen size and hemoglobin, and decompensations including hepatic encephalopathy or jaundice, gained relevance in decompensated patients. CONCLUSIONS: NOD2 risk variants are associated with BI in cirrhosis. The genetic effect on BI is strongest in compensated patients, whereas in decompensated patients their presence is less relevant. In this situation, CSPH becomes an independent factor associated with BI.