(Imām Bukhārī narrates): Hamid bin Umar narrated to us from Hammad bin Zaid from Ayyub from Muhammad, that Anas bin Malik, may Allāh be pleased with him, said that
the Messenger of Allāh ﷺ led the prayer on the day of Nahr, then gave the sermon, so he commanded that whoever had slaughtered (the sacrifice) before the prayer should slaughter again. So a man from the Ansar stood up, and he said: O Messenger of Allāh! I have neighbours — either he said that they were very hungry, or he said: they were in great need — and I slaughtered the sacrifice before the prayer, and I have a kid, six months old, which has meat more pleasing than the meat of two goats. So he gave him permission for it (as his sacrifice).
حَدَّثَنَا حَامِدُ بْنُ عُمَرَ عَنْ حَمَّادِ بْنِ زَيْدٍ عَنْ أَيُّوبَ عَنْ مُحَمَّدٍ أَنَّ أَنَسَ بْنَ مَالِكٍ قَالَ إِنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ صَلَّى يَوْمَ النَّحْرِ ثُمَّ خَطَبَ فَأَمَرَ مَنْ ذَبَحَ قَبْلَ الصَّلَاةِ أَنْ يُعِيدَ ذَبْحَهُ فَقَامَ رَجُلٌ مِنْ الْأَنْصَارِ فَقَالَ يَا رَسُولَ اللَّهِ جِيرَانٌ لِي إِمَّا قَالَ بِهِمْ خَصَاصَةٌ وَإِمَّا قَالَ بِهِمْ فَقْرٌ وَإِنِّي ذَبَحْتُ قَبْلَ الصَّلَاةِ وَعِنْدِي عَنَاقٌ لِي أَحَبُّ إِلَيَّ مِنْ شَاتَيْ لَحْمٍ فَرَخَّصَ لَهُ فِيهَا
Reference: Sahih Al Bukhari 984