I was present with the Prophet ﷺ on the Day of Sacrifice, and he said, "Whoever slaughtered before performing the prayer must offer another sacrifice in its place, and whoever has not yet slaughtered should now do so."
شهدت النبي ﷺ يوم النحر فقال: من ذبح قبل أن يصلي فليعد مكانها أخرى، ومن لم يذبح فليذبح.
Bukhari narrated it in the chapter on sacrifices (5562), and Muslim in the chapter on sacrifices (3:1960), both through the route of Shubah, who said, Aswad bin Qays narrated to us, saying, I heard Jundab bin Sufyan Bajali, and he mentioned it.