Sayyiduna Abdullah bin Mughaffal (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "If you are in a sheep pen and the time of prayer comes, pray in it, for there is tranquillity and blessing in it. And if the time of prayer comes while you are in a camel pen, leave it and pray somewhere else; they were created from jinn. Do you not see how, when it bolts, it turns up its nose?"
(b) Imam al-Shafi'i (may Allah have mercy on him) said, in the narration of Abu Sa'id: The saying of the Prophet (peace and blessings be upon him): "Do not pray in the pens of camels, for they were created from jinn" is evidence that he forbade it only in the way that, when he (peace and blessings be upon him) slept past the prayer in a valley, he said: "Leave this valley, for there is a devil in it." He (peace and blessings be upon him) disliked praying near a devil, and likewise he disliked praying near camels, because they too were created from jinn, not because their place is impure. And about sheep he said: "They are among the animals of Paradise."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4358