Issues regarding antibiotic use in end-of-life patients with advanced cancer present a challenging ethical dilemma in academic referral centres. This study aimed to investigate the role of palliative care consultation on antibiotic prescription patterns among hospitalized patients with advanced cancer during their last days of life. This retrospective cohort study included adult patients with metastatic solid cancer admitted to a tertiary referral hospital for at least 4 days and subsequently died and who were given antibiotics 4 days before death between January 2018 and December 2021. Patients were divided into palliative care consultation (PC) and non-consultation (non-PC) groups. The outcomes were the proportion of patients who received antibiotic combination treatment, antibiotic escalation and antibiotic de-escalation within 3 days of death. Propensity score analysis with the inverse probability of the treatment weighting method was used to compare the outcomes. Among the 1177 patients enrolled, 476 (40.4%) received palliative care consultation and 701 (59.6%) did not. The PC group received considerably less antibiotic combination treatment (49.0% versus 61.1%, adjusted OR: 0.69, 95% CI: 0.53-0.90, P = 0.006) and antibiotic escalation (15.8% versus 34.8%, adjusted OR: 0.41, 95% CI: 0.30-0.57, P < 0.001) than the non-PC group. Additionally, the PC group reported significantly higher antibiotic de-escalation (30.7% versus 17.4%, adjusted OR: 1.74, 95% CI: 1.28-2.36, P < 0.001). Receiving palliative care consultation may minimize aggressive antibiotic prescription patterns in the last days of patients with advanced cancer in an academic referral centre setting.