Inflammation and diet have been suggested to be important risk factors for hepatocellular cancer (HCC). This Italian multicentre hospital-based case–control study conducted between 1999 and 2002 and including 185 cases with incident, histologically confirmed HCC, and 404 controls hospitalised for acute non-neoplastic diseases provided an opportunity to investigate the association between HCC and the dietary inflammatory index (DII). The DII was computed on the basis of dietary intake assessed 2 years before the date of interview by a validated sixty-three-item FFQ. Logistic regression models were used to estimate OR adjusted for age, sex, study centre, education, BMI, smoking, physical activity, serum markers of hepatitis B and C infection and energy intake. Energy adjustment for DII was performed using the residual method. Participants in the highest tertile of DII scores (i.e. with a more pro-inflammatory diet) had a higher risk for HCC (ORtertile 3 v, 1 2·43; 95 % CI 1·27, 4·68; Ptrend=0·03). When stratified by the presence or absence of hepatitis B/C infection and sex, DII was strongly associated with HCC in hepatitis B- and C-negative participants (ORtertile 3 v. 1 4·18; 95 % CI 1·53, 11·39; Ptrend=0·02) and among males (ORtertile 3 v. 1 3·60; 95 % CI 1·65, 7·87; Ptrend=0·001). These results indicate that a pro-inflammatory diet is associated with increased risk for HCC, in those without a history of hepatitis B/C infection and among males.