Sahih Muslim Book 22, Hadith Number 4833.

Chapter : The proper time for sacrifice.

Anas (b. Malik) reported Allah’s Messenger (may peace be upon him) having said on the day of Nahr (Sacrifice): He who slaughtered (the animal as a sacrifice) before the (‘Id) prayer should repeat it (i.e. offer another animal). Thereupon a person stood up and said: Messenger of Allah, that is the day when meat is much desired, and he also made a mention of the need of his neighbour, and perhaps Allah’s Messenger (may peace be upon him) attested it. He (the person who had sacrificed the animal before the ‘Id prayer) said: I have a goat of less than one year of age with me and I like it more than two fleshy goats; should I offer it as a sacrifice? He permitted him to do so. He (the narrator) said: I do not know whether this permission was granted to anyone else besides him or not. Allah’s Messenger (may peace be upon him) then turned towards two rams and he slaughtered them, and the people’ came to the goats and got them distributed amongst themselves (for offering them as sacrifice).