The Messenger of Allah ﷺ used to pray on Eid al-Adha and Eid al-Fitr, then deliver the sermon after the prayer.In another narration, the Messenger of Allah ﷺ, Abu Bakr, and Umar would perform the two Eid prayers before the sermon.
أن رسول الله ﷺ كان يصلي في الأضحى والفطر، ثم يخطب بعد الصلاة. وفي رواية: كان رسول الله ﷺ وأبو بكر وعمر رضي الله عنهما يصلون العيدين قبل الخطبة.
The first narration was reported by Bukhari in the book of Eids (957), from Ibrahim bin Munzir, who said, Anas narrated to us, from Ubaydullah, from Nafi, from Ibn Umar, and he related it.The second narration was reported by Bukhari in the book of Eids (963), and Muslim in the book of Eids (888), both by way of Abu Usama, from Ubaydullah, from Nafi, from Ibn Umar, and he related the same.