Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Sheep are among the animals of Paradise; wipe the mucus from their noses and pray in their pens."
Imam al-Shafi'i (may Allah have mercy on him) said: He (peace and blessings be upon him) commanded that prayer be offered in their pens, meaning, and Allah knows best, in the place that is called their pen in which there are neither droppings nor urine. He said: I consider praying in the pens of camels disliked (makruh), even if there is no filth in them, because the Prophet (peace and blessings be upon him) forbade it. If someone does pray there, his prayer is valid, because the Prophet (peace and blessings be upon him) was praying when a devil passed by him (peace and blessings be upon him); he (peace and blessings be upon him) squeezed its throat and felt the coolness of its tongue on his hand, and that did not invalidate his (peace and blessings be upon him) prayer.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4360