The objective of the present study was to investigate the influence of the single nucleotide polymorphism (rs17238540) at the 3-hydroxy-3-methylglutaryl-coenzyme A reductase gene (HMGCR) on the relationship between serum lipids and dietary fat and fibre (NSP). FFQ and pyrosequencing were used to assess cross-sectional dietary intake and HMGCR genotype in a population study with data for serum lipids available. Genotype frequencies and allele distributions for 23 011 participants were: TT 95·65 %, TG 4·29 % and GG 0·06 %; T 97·8 % and G 2·2 %. In regression analyses, the TG+GG group showed a significant positive relationship between TAG and SFA intake (+0·11 (95 % CI 0·02, 0·20) mmol TAG/l; P = 0·017; per 3 % SFA energy increase) while the TT individuals showed no change in the TAG levels related to SFA intake ( − 0·0007 (95 % CI − 0·02, 0·02) mmol TAG/l; P = 0·99). TG+GG individuals showed an inverse relationship between TAG and fibre intake higher ( − 0·14 (95 % CI − 0·22, − 0·05) mmol TAG/l than the TT group ( − 0·04 (95 % CI − 0·06, − 0·02) mmol TAG/l). In both cases the respective coefficient regressions of TAG were different between the genotype groups (Z = 2·27, P = 0·023 for SFA intake; Z = 2·19, P = 0·029 for fibre intake). Individuals carrying the G allele may show a greater response in lower TAG levels with reduced SFA intake and increased fibre intake compared with those homozygous for the T allele. The effectiveness of different dietary interventions to control serum lipids may vary according to HMGCR genotype.