Narrated Al-Bara’ bin ‘Azib: The Messenger of Allah (peace be upon him) delivered a sermon to us on the day of sacrifice after the prayer. He said: If anyone prays like our prayer, and sacrifices like our sacrifice, his sacrifice is all right. If anyone sacrifices before the prayer (for ‘Id), that is goat meant for flesh. Abu Burdah b. Niyar stood up and said: Messenger of Allah (peace be upon him), I swear by Allah, I sacrificed before I went for prayer. I thought it was the day of eating and drinking; so I made haste, and ate myself, and supplied flesh to my family and neighbors. The Messenger of Allah (peace be upon him) said: That is a goat meant for eating flesh. He said: I have a kid (of less than a year) which is better than two goats meant for flesh. Will it be valid from me? He said: Yes, but it will not be valid for anyone after you.
Sunan Abi Dawud, Book 16, Hadith 13