Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) relates: I came riding a she-donkey, and in those days I was close to puberty. the Messenger of Allah (peace and blessings be upon him) was leading the people in prayer at Mina. I passed in front of part of the row, got down from the she-donkey, let it loose to graze, and went and joined the row. No one objected to me.
In the narration of Imam al-Shafi'i (may Allah have mercy on him): I let my donkey loose to graze and myself joined the row, and no one objected to me.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3501