Aims: The association between lung cancer and idiopathic pulmonary fibrosis (IPF) is well known, but the significance of this association is poorly understood. Bronchiolar honeycomb cysts have been proposed as possible precursors for the development of carcinoma, but limited evidence in support of this hypothesis is available. The aim of this study was to investigate this hypothesis analysing a series of carcinomas arising in IPF by immunohistochemistry. Methods and results: Thirty-three lung carcinomas arising in patients with IPF were analysed with a panel of immunohistochemical markers. The antibodies included those against pneumocyte markers [thyroid transcription factor 1 (TTF1), napsin-A, and surfactant protein A], the goblet cell marker mucin 5AC, markers of basal/squamous cell differentiation [cytokeratin (CK) 5/6 and ΔN-p63] , and markers related to enteric differentiation (CDX2, mucin 2, CK20, and villin). A series of 100 consecutive lung adenocarcinomas arising in smokers without IPF were investigated as controls. All carcinomas arising in IPF patients were peripherally located on imaging analysis. The diagnoses were: eight squamous cell carcinomas, 20 adenocarcinomas, three small-cell carcinomas (including one composite small-cell carcinoma and adenocarcinoma), and two large-cell carcinomas. Among adenocarcinomas, a 'pneumocyte' profile (TTF1/napsin-A/SPA1-triple-positive) was observed in seven of 20 (35% versus 84% in non-IPF controls, P = 0.0001). The remaining 13 adenocarcinomas (65%) showed rare histotypes: four invasive mucinous adenocarcinomas (20% in IPF patients versus 1% in non-IPF controls, P = 0.002), seven tumours (35%) that were characterized by variable expression of markers of enteric differentiation, and two tumours (10%) that showed a peculiar basaloid component. Conclusions: The immunohistochemical characterization of carcinomas arising in IPF patients shows striking divergence from that in non-IPF smokers. The prevalence of rare entities showing bronchiole-related markers is in line with the hypothesis that these tumours arise from transformed small airways in honeycomb lung areas where abnormal bronchiolar proliferation takes place. © 2017 John Wiley & Sons Ltd.