Breast cancer is a molecularly, biologically and clinically heterogeneous group of disorders. Understanding this diversity is essential to improving diagnosis and optimizing treatment. Both genetic and acquired epigenetic abnormalities participate in cancer, but the involvement of the epigenome in breast cancer and its contribution to the complexity of the disease are still poorly understood. By means of DNA methylation profiling of 248 breast tissues, we have highlighted the existence of previously unrecognized breast cancer groups that go beyond the currently known ‘expression subtypes’. Interestingly, we showed that DNA methylation profiling can reflect the cell type composition of the tumour microenvironment, and in particular a T lymphocyte infiltration of the tumours. Further, we highlighted a set of immune genes having high prognostic value in specific tumour categories. The immune component uncovered here by DNA methylation profiles provides a new perspective for the importance of the microenvironment in breast cancer, holding implications for better management of breast cancer patients.