Previous studies have indicated that histone methylations act as mediators in the relationship between oestrogen receptor (ER) and breast cancer prognosis, yet the mediating role has never been assessed. Therefore, we investigated seven histone methylations (H3K4me2, H3K4me3, H3K9me1, H3K9me2, H3K9me3, H3K27me3 and H4K20me3) to determine whether they mediate the prognostic impact of ER on breast cancer. Tissue microarrays were constructed from 1045 primary invasive breast tumours, and the expressions of histone methylations were examined by immunohistochemistry. Multifactorial logistic regression was used to analyse the associations between ER and histone methylations. Cox proportional hazard model was performed to assess the relationship between histone methylations and breast cancer prognosis. The mediation effects of histone methylations were evaluated by model-based causal mediation analysis. High expressions of H3K9me1, H3K9me2, H3K4me2, H3K27me3, H4K20me3 were associated with ER positivity, while high expression of H3K9me3 was associated ER negativity. Higher H3K9me2, H3K4me2 and H4K20me3 levels were associated with better prognosis. The association between ER and breast cancer prognosis was most strongly mediated by H4K20me3 (29.07% for OS; 22.42% for PFS), followed by H3K4me2 (11.5% for OS; 10.82% for PFS) and least by H3K9me2 (9.35% for OS; 7.34% for PFS). H4K20me3, H3K4me2 and H3K9me2 mediated the relationship between ER and breast cancer prognosis, which would help to further elucidate the impact of ER on breast cancer prognosis from an epigenetic perspective and provide new ideas for breast cancer treatment.